Skip to content

Commit

Permalink
bail out to rect if radius is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriopass committed Dec 23, 2023
1 parent bec5188 commit 0822a89
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/yakui-widgets/src/shapes.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::f32::consts::TAU;

use yakui_core::geometry::{Color, Rect, Vec2};
use yakui_core::paint::{PaintDom, PaintMesh, Vertex};
use yakui_core::paint::{PaintDom, PaintMesh, PaintRect, Vertex};

pub fn cross(output: &mut PaintDom, rect: Rect, color: Color) {
static POSITIONS: [[f32; 2]; 12] = [
Expand Down Expand Up @@ -179,6 +179,10 @@ impl RoundedRectangle {
}

pub fn add(&self, output: &mut PaintDom) {
if self.radius <= 0.0 {
return PaintRect::new(self.rect).add(output);
}

let rect = self.rect;
let color = self.color.to_linear();

Expand Down

0 comments on commit 0822a89

Please sign in to comment.