@geastack/engine 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,12 +36,13 @@
36
36
  // handlers fire.
37
37
 
38
38
  #include "virtual_keyboard.h"
39
+ #include "node_features.h"
39
40
 
40
41
  #ifndef GEA_EMBEDDED_ENABLE_VIRTUAL_KEYBOARD
41
42
  #define GEA_EMBEDDED_ENABLE_VIRTUAL_KEYBOARD 1
42
43
  #endif
43
44
 
44
- #if GEA_EMBEDDED_ENABLE_VIRTUAL_KEYBOARD
45
+ #if GEA_EMBEDDED_ENABLE_VIRTUAL_KEYBOARD && GEA_UI_INPUT_NODES
45
46
 
46
47
  #include "display.h"
47
48
  #include "internal.h"
@@ -424,8 +425,8 @@ void mountIfNeeded()
424
425
  // the parent's padding from our offsets — negative Left/Top
425
426
  // cancels the inset.
426
427
  const Node &parent = tree.node(tree.mountedRoot());
427
- const int padTop = parent.style.padding[0];
428
- const int padLeft = parent.style.padding[3];
428
+ const int padTop = parent.computedStyle().padding[0];
429
+ const int padLeft = parent.computedStyle().padding[3];
429
430
 
430
431
  const KbMetrics m = kbMetrics();
431
432
  // Float the keyboard above any reserved bottom overlay (home button)
@@ -579,7 +580,9 @@ void applyKeyToActiveInput(int code)
579
580
  Node &nn = tree.node(nodeId);
580
581
  nn.render.dirty = 1;
581
582
  nn.render.layout_dirty = 1;
583
+ #if GEA_CSS_SCROLLING
582
584
  nn.render.non_scroll_dirty = 1;
585
+ #endif
583
586
  };
584
587
 
585
588
  if (code == kCodeBackspace) {
@@ -699,12 +702,16 @@ void applyAppResize()
699
702
  gState.savedStyleCount = 0;
700
703
  // Snapshot every computed value we are about to overwrite before the
701
704
  // first setStyle lands, so none of them is read back post-mutation.
702
- const int prevHeight = n.style.height;
703
- const int prevFlex = n.style.flex;
704
- const int prevOverflowY = n.style.overflow_y;
705
- const int prevPosition = n.style.position;
706
- const int prevTop = n.style.pos_offsets[0];
707
- const int prevLeft = n.style.pos_offsets[3];
705
+ const int prevHeight = n.computedStyle().height;
706
+ const int prevFlex = n.computedStyle().flex;
707
+ #if GEA_CSS_OVERFLOW_AXES
708
+ const int prevOverflowY = n.computedStyle().overflow_y;
709
+ #else
710
+ const int prevOverflowY = n.computedStyle().overflow;
711
+ #endif
712
+ const int prevPosition = n.computedStyle().position;
713
+ const int prevTop = GEA_CSS_POSITION_PX_0(n.computedStyle());
714
+ const int prevLeft = GEA_CSS_POSITION_PX_3(n.computedStyle());
708
715
  const int viewportH = tree.mountedHeight();
709
716
  // Available vertical space between the top of this node (set by
710
717
  // previous siblings' heights during the most recent layout pass)
@@ -721,8 +728,8 @@ void applyAppResize()
721
728
  // band of the old screen. Absolute takes it out of the parent's flow so
722
729
  // it cannot move; restore puts the original position styles back.
723
730
  const Node &parentNode = tree.node(n.parent >= 0 ? n.parent : target);
724
- const int pinTop = n.layout.y - parentNode.layout.y - parentNode.style.padding[0];
725
- const int pinLeft = n.layout.x - parentNode.layout.x - parentNode.style.padding[3];
731
+ const int pinTop = n.layout.y - parentNode.layout.y - parentNode.computedStyle().padding[0];
732
+ const int pinLeft = n.layout.x - parentNode.layout.x - parentNode.computedStyle().padding[3];
726
733
  pinStyle(tree, target, Property::Position, prevPosition, 1);
727
734
  pinStyle(tree, target, Property::Top, prevTop, pinTop);
728
735
  pinStyle(tree, target, Property::Left, prevLeft, pinLeft);