@@ -225,14 +225,6 @@ void updateTimelineProperties(WidgetTimeline &widgetTimeline, float timelinePosi
225
225
float scale = widgetTimeline.scale ;
226
226
float rotate = widgetTimeline.rotate ;
227
227
228
- bool setX = false ;
229
- bool setY = false ;
230
- bool setWidth = false ;
231
- bool setHeight = false ;
232
- bool setOPA = false ;
233
- bool setScale = false ;
234
- bool setRotate = false ;
235
-
236
228
for (auto itKeyframe = widgetTimeline.timeline .begin (); itKeyframe != widgetTimeline.timeline .end (); itKeyframe++) {
237
229
TimelineKeyframe &keyframe = *itKeyframe;
238
230
@@ -273,14 +265,10 @@ void updateTimelineProperties(WidgetTimeline &widgetTimeline, float timelinePosi
273
265
auto p2 = keyframe.x ;
274
266
x = (1 - t2) * p1 + t2 * p2;
275
267
}
276
-
277
- setX = true ;
278
268
}
279
269
280
270
if (keyframe.enabledProperties & WIDGET_TIMELINE_PROPERTY_WIDTH) {
281
271
w += eez::g_easingFuncs[keyframe.widthEasingFunc ](t) * (keyframe.width - w);
282
-
283
- setWidth = true ;
284
272
}
285
273
286
274
if (keyframe.enabledProperties & WIDGET_TIMELINE_PROPERTY_Y) {
@@ -309,32 +297,22 @@ void updateTimelineProperties(WidgetTimeline &widgetTimeline, float timelinePosi
309
297
auto p2 = keyframe.y ;
310
298
y = (1 - t2) * p1 + t2 * p2;
311
299
}
312
-
313
- setY = true ;
314
300
}
315
301
316
302
if (keyframe.enabledProperties & WIDGET_TIMELINE_PROPERTY_HEIGHT) {
317
303
h += eez::g_easingFuncs[keyframe.heightEasingFunc ](t) * (keyframe.height - h);
318
-
319
- setHeight = true ;
320
304
}
321
305
322
306
if (keyframe.enabledProperties & WIDGET_TIMELINE_PROPERTY_OPACITY) {
323
307
opacity += eez::g_easingFuncs[keyframe.opacityEasingFunc ](t) * (keyframe.opacity - opacity);
324
-
325
- setOPA = true ;
326
308
}
327
309
328
310
if (keyframe.enabledProperties & WIDGET_TIMELINE_PROPERTY_SCALE) {
329
311
scale += eez::g_easingFuncs[keyframe.scaleEasingFunc ](t) * (keyframe.scale - scale);
330
-
331
- setScale = true ;
332
312
}
333
313
334
314
if (keyframe.enabledProperties & WIDGET_TIMELINE_PROPERTY_ROTATE) {
335
315
rotate += eez::g_easingFuncs[keyframe.rotateEasingFunc ](t) * (keyframe.rotate - rotate);
336
-
337
- setRotate = true ;
338
316
}
339
317
340
318
break ;
@@ -368,49 +346,35 @@ void updateTimelineProperties(WidgetTimeline &widgetTimeline, float timelinePosi
368
346
369
347
lv_style_value_t value;
370
348
371
- if (setX) {
372
- value.num = (int16_t )roundf (x);
373
- lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_X, value, LV_PART_MAIN);
374
- }
349
+ value.num = (int16_t )roundf (x);
350
+ lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_X, value, LV_PART_MAIN);
375
351
376
- if (setY) {
377
- value.num = (int16_t )roundf (y);
378
- lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_Y, value, LV_PART_MAIN);
379
- }
352
+ value.num = (int16_t )roundf (y);
353
+ lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_Y, value, LV_PART_MAIN);
380
354
381
- if (setWidth) {
382
- value.num = (int16_t )roundf (w);
383
- lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_WIDTH, value, LV_PART_MAIN);
384
- }
355
+ value.num = (int16_t )roundf (w);
356
+ lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_WIDTH, value, LV_PART_MAIN);
385
357
386
- if (setHeight) {
387
- value.num = (int16_t )roundf (h);
388
- lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_HEIGHT, value, LV_PART_MAIN);
389
- }
358
+ value.num = (int16_t )roundf (h);
359
+ lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_HEIGHT, value, LV_PART_MAIN);
390
360
391
- if (setOPA) {
392
- value.num = (int32_t )roundf (opacity * 255 .0f );
393
- lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_OPA, value, LV_PART_MAIN);
394
- }
361
+ value.num = (int32_t )roundf (opacity * 255 .0f );
362
+ lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_OPA, value, LV_PART_MAIN);
395
363
396
- if (setScale) {
397
- value.num = (int32_t )roundf (scale);
364
+ value.num = (int32_t )roundf (scale);
398
365
#if LVGL_VERSION_MAJOR >= 9
399
- lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_TRANSFORM_SCALE_X, value, LV_PART_MAIN);
400
- lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_TRANSFORM_SCALE_Y, value, LV_PART_MAIN);
366
+ lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_TRANSFORM_SCALE_X, value, LV_PART_MAIN);
367
+ lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_TRANSFORM_SCALE_Y, value, LV_PART_MAIN);
401
368
#else
402
- lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_TRANSFORM_ZOOM, value, LV_PART_MAIN);
369
+ lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_TRANSFORM_ZOOM, value, LV_PART_MAIN);
403
370
#endif
404
- }
405
371
406
- if (setRotate) {
407
- value.num = (int32_t )roundf (rotate);
372
+ value.num = (int32_t )roundf (rotate);
408
373
#if LVGL_VERSION_MAJOR >= 9
409
- lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_TRANSFORM_ROTATION, value, LV_PART_MAIN);
374
+ lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_TRANSFORM_ROTATION, value, LV_PART_MAIN);
410
375
#else
411
- lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_TRANSFORM_ANGLE, value, LV_PART_MAIN);
376
+ lv_obj_set_local_style_prop (widgetTimeline.obj , LV_STYLE_TRANSFORM_ANGLE, value, LV_PART_MAIN);
412
377
#endif
413
- }
414
378
}
415
379
416
380
void doAnimateFlowState (eez::flow::FlowState *flowState) {
0 commit comments