Skip to content

Commit baa1811

Browse files
avivianavivianbodymovin
committed
use varuint for writing/reading objectid, total properties and property key in animation reset
objectId, propertykey are definitely written as varuint, not sure if properties total needs to be, but doesn't hurt to have it that way either I think. I'm not sure if this is everything that needs to be updated. I tried to use `generate_core_runtime` to update the flutter runtime but that made a bunch of changes like unused imports all over the place... Diffs= 07cbce551 use varuint for writing/reading objectid, total properties and property key in animation reset (#7510) Co-authored-by: Arthur Vivian <[email protected]> Co-authored-by: Hernan Torrisi <[email protected]>
1 parent 532ad4f commit baa1811

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.rive_head

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f9b1e8ec2ff7960990f87ef855c669f6a4a86b1d
1+
07cbce5511e451396513f9d092a72193d41844f5

lib/src/rive_core/animation/animation_reset_factory.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ class AnimationReset {
3333
}
3434

3535
void writeObjectId(int id) {
36-
_writer.writeInt8(id);
36+
_writer.writeVarUint(id);
3737
}
3838

3939
void writeTotalProperties(int totalProperties) {
40-
_writer.writeInt8(totalProperties);
40+
_writer.writeVarUint(totalProperties);
4141
}
4242

4343
void writePropertyKey(int propertyKey) {
44-
_writer.writeInt8(propertyKey);
44+
_writer.writeVarUint(propertyKey);
4545
}
4646

4747
void writeColor(int value) {
@@ -74,15 +74,15 @@ class AnimationReset {
7474
reader.readIndex = 0;
7575
while (reader.readIndex < _dataSize) {
7676
// First we read the object's id
77-
final objectIntId = reader.readInt8();
77+
final objectIntId = reader.readVarUint();
7878
final objectId = resolveId(objectIntId);
7979
final object = core.resolve<Core>(objectId);
8080
// Second we read how many keyframed properties it has
81-
final totalProperties = reader.readInt8();
81+
final totalProperties = reader.readVarUint();
8282
int currentPropertyIndex = 0;
8383
while (currentPropertyIndex < totalProperties) {
8484
// Third we read the property key for each property
85-
final propertyKey = reader.readInt8();
85+
final propertyKey = reader.readVarUint();
8686
// Fourth we read the property value for each property
8787
if (_isDouble(propertyKey, object!)) {
8888
double value = reader.readFloat32();

0 commit comments

Comments
 (0)