Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
j committed Oct 22, 2024
1 parent c1c9a93 commit c136cf1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 32 deletions.
47 changes: 23 additions & 24 deletions haxe/ui/backend/ComponentImpl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ class ComponentImpl extends ComponentBase {

override function handleClipRect(value:Rectangle):Void {
// @TODO fix clipping with absolute/box
//return;
if (this.parentComponent == null) {
return;
}
Expand All @@ -131,11 +130,9 @@ class ComponentImpl extends ComponentBase {
filter.textureFilter = NEAREST;
filter.density = App.app.screen.nativeDensity;
filter.antialiasing = Screen.instance.options.antialiasing;
//filter.depth = ;
filter.depthRange = -1;

if (parent == null) {
visual.parent.add(filter);
// filter.depthRange = 0;
// trace('here');
} else if (parent.isClipped) {
parent.filter.content.add(filter);
Expand Down Expand Up @@ -230,25 +227,25 @@ class ComponentImpl extends ComponentBase {
var depth_counter = 0;

private override function handleSetComponentIndex(child:Component, index:Int) {
child.visual.depth = index;
child.visual.depth = index + 2;
mapChildren();
}

private override function handleAddComponent(child:Component):Component {
// child.visual.depth = child.depth;
// trace(this.depth);
var v = this.depth;
var v = this.depth + 2;
// if (v < 2) {
// v = 2;
// }

//child.visual.depth = this.depth;
child.visual.depth = this.depth + 2;
this.add(child.visual);
return child;
}

private override function handleAddComponentAt(child:Component, index:Int):Component {
child.visual.depth = index;
child.visual.depth = index + 2;
this.add(child.visual);
mapChildren();
return child;
Expand Down Expand Up @@ -326,41 +323,43 @@ class ComponentImpl extends ComponentBase {
visual.border_size = 0;
visual.border_color = Color.NONE;
case Full:
//trace(style.borderSize, style.borderLeftSize, style.borderRightSize, style.borderTopSize, style.borderBottomSize);
visual.border_size = 0;
visual.border_color = Color.NONE;
//trace(style.borderSize, style.borderLeftSize, style.borderRightSize, style.borderTopSize, style.borderBottomSize);

if (style.borderSize != null) {
visual.border_size = style.borderSize;
visual.border_color = style.borderColor ?? Color.NONE;

if (style.borderSize > 0) {
visual.border_color = style.borderColor;
}
}
case Compound:

if (style.borderLeftSize != null) {
visual.border_left_size = style.borderLeftSize;
visual.border_left_color = (style.borderLeftColor ?? Color.NONE);
} else {
visual.border_left_size = 0;
if (style.borderLeftSize > 0) {
visual.border_left_color = (style.borderLeftColor);
}
}

if (style.borderRightSize != null) {
visual.border_right_size = style.borderRightSize;
visual.border_right_color = (style.borderRightColor ?? Color.NONE);
} else {
visual.border_right_size = 0;
if (style.borderRightSize > 0) {
visual.border_right_color = (style.borderRightColor);
}
}

if (style.borderTopSize != null) {
visual.border_top_size = style.borderTopSize;
visual.border_top_color = (style.borderTopColor ?? Color.NONE);
} else {
visual.border_top_size = 0;
if (style.borderTopSize > 0) {
visual.border_top_color = (style.borderTopColor);
}
}

if (style.borderBottomSize != null) {
visual.border_bottom_size = style.borderBottomSize;
visual.border_bottom_color = (style.borderBottomColor ?? Color.NONE);
} else {
visual.border_bottom_size = 0;
if (style.borderBottomSize > 0) {
visual.border_bottom_color = (style.borderBottomColor);
}
}
default:
trace(type, this._id, this.id, this.visual.id);
Expand Down
2 changes: 1 addition & 1 deletion haxe/ui/backend/ComponentSurface.hx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ComponentSurface {
}

public inline function add(visual:Visual) {
visual.depthRange = -1;
//visual.depthRange = -1;
this.visual.add(visual);
}

Expand Down
5 changes: 2 additions & 3 deletions haxe/ui/backend/ScreenImpl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ScreenImpl extends ScreenBase {

function mapComponents() {
for (k => c in this.rootComponents) {
//c.visual.depth = k;
c.visual.depth = k;
if (c.visual.children != null) {
//c.visual.sortChildrenByDepth();
}
Expand All @@ -42,7 +42,6 @@ class ScreenImpl extends ScreenBase {
resizeComponent(c);
rootComponents.push(component);
component.visual.active = true;
//component.visual.depth = component.depth;
rootAdd(c.visual);
this.mapComponents();
return c;
Expand Down Expand Up @@ -289,7 +288,7 @@ function onKey(type:String, key:Key) {
parent.explicitRender = true;
#end

//parent.depth = 1000;
parent.depth = 1000;
options.root = parent;
options.root.bindToNativeScreenSize();
}
Expand Down
9 changes: 5 additions & 4 deletions haxe/ui/backend/ceramic/BorderQuad.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class BorderQuad extends Visual {
border = new Border();
border.inheritAlpha = true;
border.size(width, height);
border.depth = -4;
border.depth = 1;
border.borderSize = 0;
this.add(border);
}
border.active = true;
Expand All @@ -50,7 +51,7 @@ class BorderQuad extends Visual {
sliceBackground = new NineSlice();
sliceBackground.inheritAlpha = true;
sliceBackground.size(width, height);
sliceBackground.depth = -5;
sliceBackground.depth = 0;
this.add(sliceBackground);
this.isSlice = true;
}
Expand All @@ -76,7 +77,7 @@ class BorderQuad extends Visual {
background = new Quad();
background.inheritAlpha = true;
background.size(width, height);
background.depth = -5;
background.depth = 0;
this.add(background);
}

Expand Down Expand Up @@ -111,7 +112,7 @@ class BorderQuad extends Visual {
width, height
];
gbackground.size(width, height);
gbackground.depth = -5;
gbackground.depth = 0;
this.add(gbackground);
}

Expand Down

0 comments on commit c136cf1

Please sign in to comment.