JakeWharton / scalpel

A surgical debugging tool to uncover the layers under your app.
Apache License 2.0
2.76k stars 231 forks source link

Siblings Occupying The Same Area Need Stacked #15

Open JakeWharton opened 10 years ago

JakeWharton commented 10 years ago

Currently siblings are always drawn on the same layer. This is actually bad if you have overlapping views as they and their children can draw over each other on the same level.

A second child which overlaps need to be prompted to a layer higher than its sibling (and all its children).

ndorigatti commented 10 years ago

but how do you get who is over who? ie using a relative layout you have to relay on who is declared before or after?

JakeWharton commented 10 years ago

After is always higher since it mirrors the default drawing order. We can't detect the actual drawing order since the method isn't exposed, but 99.99% of the time it's ascending from first to last child.

ndorigatti commented 10 years ago

mmm so we have nothing more than a "almost ever"... Makes sense, even if i think that the Z explosion is more important for looking at childs and view layers, and two siblings are on the same layer (it's borderilne). Just think at a view with tens of childrens, you will have too big explosion, don't you? And why not using gl for drawing the stuff? You can have very nice performances and you can manage zoom and Z value with a really fine accuracy...

JakeWharton commented 10 years ago

As I see it, it's 10x the code for 2x the benefit.

ndorigatti commented 10 years ago

Yes, to me, it depends on how do you know gl. Having worked on it a bit i see differently, but your code is perfect right now. I really like the trick for the "3D" while rotating.