Skip to content

Commit

Permalink
allow domkit apply recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Feb 18, 2022
1 parent 0dd4342 commit db7c1ee
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion domkit/CssStyle.hx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ class CssStyle {
var currentTransitions : Array<CssTransition> = [];
var componentsBits : FastBytes;
var compSize : Int = 0;
var inApply = false;

public function new() {
data = new CssData();
Expand Down Expand Up @@ -358,13 +359,23 @@ class CssStyle {
compSize = data.bytesSize;
componentsBits = haxe.io.Bytes.alloc(compSize);
}
componentsBits.fill(0,compSize,0);
var prevApply = inApply;
var prevBits = null;
if( prevApply ) {
prevBits = componentsBits;
componentsBits = haxe.io.Bytes.alloc(compSize);
} else
componentsBits.fill(0,compSize,0);
var cur = e.parent;
while( cur != null ) {
setCompBit(cur.component.id);
cur = cur.parent;
}
this.inApply = true;
applyStyleRec(e, force, null);
this.inApply = prevApply;
if( prevApply )
componentsBits = prevBits;
}

function applyStyleRec( e : Properties<Dynamic>, force : Bool, rules : Array<Rule> ) {
Expand Down

0 comments on commit db7c1ee

Please sign in to comment.