mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-25 08:28:42 -06:00
skip rendering transparent rects
This commit is contained in:
parent
2863bbdf8a
commit
e7b2a8ff69
|
@ -25,6 +25,9 @@ impl Frame for ImageHandle {
|
||||||
|
|
||||||
impl Frame for FillColor {
|
impl Frame for FillColor {
|
||||||
fn draw(&self, draw: &mut UiDrawCommandList, rect: Rect) {
|
fn draw(&self, draw: &mut UiDrawCommandList, rect: Rect) {
|
||||||
|
if self.is_transparent() {
|
||||||
|
return
|
||||||
|
}
|
||||||
draw.add(UiDrawCommand::Rectangle {
|
draw.add(UiDrawCommand::Rectangle {
|
||||||
position: rect.position,
|
position: rect.position,
|
||||||
size: rect.size,
|
size: rect.size,
|
||||||
|
|
|
@ -116,6 +116,9 @@ impl Default for RectFrame {
|
||||||
|
|
||||||
impl Frame for RectFrame {
|
impl Frame for RectFrame {
|
||||||
fn draw(&self, draw: &mut UiDrawCommandList, rect: Rect) {
|
fn draw(&self, draw: &mut UiDrawCommandList, rect: Rect) {
|
||||||
|
if self.color.is_transparent() {
|
||||||
|
return
|
||||||
|
}
|
||||||
//TODO: handle bottom_right < top_left
|
//TODO: handle bottom_right < top_left
|
||||||
let top_left = self.top_left.resolve(rect.size);
|
let top_left = self.top_left.resolve(rect.size);
|
||||||
let bottom_right = self.bottom_right.resolve(rect.size);
|
let bottom_right = self.bottom_right.resolve(rect.size);
|
||||||
|
|
Loading…
Reference in a new issue