[Fix] Quads of different background types not ordered#1873
[Fix] Quads of different background types not ordered#1873hecrj merged 9 commits intoiced-rs:masterfrom
Conversation
|
I have some ideas to improve layering overall in the backlog. For now, having gradients always be on top of solid seems consistent with the way other primitives work for a specific layer. I don't think we should introduce ordering (primitive layering) at a layer level. |
|
This is just for grouping quads together to be rendered actually in order of when they're supposed to be. Right now you can't put a container with a solid background over a container with a gradient background or else the solid will be rendered over since we're rendering all solids & then all gradients. I'm not sure where else to put ordering besides at the layer level since that's where they're being grouped, unless we want to introduce like a depth value or something to primitives. fn view(&self) -> Element<'_, Self::Message, Renderer<Self::Theme>> {
let small_center_box = container(":-)")
.center_x().center_y()
.height(100)
.width(100)
.style(theme::Container::Custom(Box::new(SolidBackgroundStyle)));
let center_box = container(small_center_box)
.center_x()
.center_y()
.height(300)
.width(300)
.style(theme::Container::Custom(Box::new(SolidBackgroundStyle)));
container(center_box)
.width(Length::Fill)
.height(Length::Fill)
.center_x()
.center_y()
.style(theme::Container::Custom(Box::new(GradientBackgroundStyle)))
.into()
} |
|
Yeah, I know. This is layering at the primitive level. Just pointing out that it shouldn't be a problem soon. But I forgot the fact that gradients can be used as backgrounds now... So we should definitely fix this before that exploration lands. I guess I'm not happy with how the implementation details of the We should move the |
5074ee8 to
10a68ac
Compare
|
Adjusted in 10a68ac 👍 |
10a68ac to
eb6c663
Compare
Not sure why I split these to begin with!
hecrj
left a comment
There was a problem hiding this comment.
Awesome!
Moved some code around to avoid the quad pipeline details from leaking into layer by removing layer::quad altogether! We should probably do the same thing with the other layer submodules; but no need to do that here.
Also simplified some minor things! Hopefully I didn't break anything.
Let's merge! 🚢
|
Found the right way to keep |
|
Looks good, we can move the other |


So caught up in the elation of lerping, I completely forgot to order quads of different background types 🤦
This will fix any issues with using quads of different background types on top of one another.
I made a separate
orderfield of thelayer::Quadsstruct to consolidate quads for rendering, similar to how we're doing it with triangle meshes already.