Files
rive-ios/Source/Renderer/RiveTextValueRun.mm
csmartdalton 17a669aad6 Drop the ColumnLimit to 80 for clang-format
This gives better support for smaller screens and side-by-side windows.

Also standardize the formatting check on GitHub on version 17.

Diffs=
e52e9fff29 Drop the ColumnLimit to 80 for clang-format (#8320)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2024-10-11 19:25:57 +00:00

53 lines
1007 B
Plaintext

//
// RiveTextValueRun.m
//
//
// Created by Zach Plata on 7/27/23.
//
#import <Rive.h>
#import <RivePrivateHeaders.h>
/*
* RiveTextValueRun
*/
@implementation RiveTextValueRun
{
const rive::TextValueRun*
instance; // note: we do NOT own this, so don't delete it
}
- (const rive::TextValueRun*)getInstance
{
return instance;
}
// Creates a new RiveTextValueRun from a cpp TextValueRun
- (instancetype)initWithTextValueRun:(const rive::TextValueRun*)textRun
{
if (self = [super init])
{
instance = textRun;
return self;
}
else
{
return nil;
}
}
- (void)setText:(NSString*)textValue
{
std::string stdName = std::string([textValue UTF8String]);
((rive::TextValueRun*)[self getInstance])->text(stdName);
}
- (NSString*)text
{
std::string str = ((const rive::TextValueRun*)instance)->text();
return [NSString stringWithCString:str.c_str()
encoding:[NSString defaultCStringEncoding]];
}
@end