MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / PiuScrollerScrollBy

Function PiuScrollerScrollBy

modules/piu/All/piuScroller.c:376–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374}
375
376void PiuScrollerScrollBy(PiuScroller* self, PiuCoordinate dx, PiuCoordinate dy)
377{
378 PiuContent* content = (*self)->first;
379 if (content) {
380 PiuFlags flags = 0;
381 if (((*content)->coordinates.horizontal & piuLeftRightWidth) == piuLeftRight) dx = 0;
382 if (((*content)->coordinates.vertical & piuTopBottomHeight) == piuTopBottom) dy = 0;
383 if (dx || dy) {
384 if ((*self)->flags & (piuClip | piuLooping))
385 PiuContentInvalidate(self, NULL);
386 else
387 PiuContentInvalidate(content, NULL);
388 if (dx) {
389 flags |= piuXChanged;
390 (*self)->delta.x += dx;
391 }
392 if (dy) {
393 flags |= piuYChanged;
394 (*self)->delta.y += dy;
395 }
396 if (flags)
397 PiuContentReflow(content, flags);
398 }
399 }
400}
401
402void PiuScrollerUpdate(void* it, PiuView* view, PiuRectangle area)
403{

Callers 4

PiuScrollerRevealFunction · 0.85
PiuScroller_set_scrollFunction · 0.85
PiuScroller_scrollByFunction · 0.85
PiuScroller_scrollToFunction · 0.85

Calls 2

PiuContentInvalidateFunction · 0.85
PiuContentReflowFunction · 0.85

Tested by

no test coverage detected