1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

fix(core): prevent negative circle rendering

[no changelog]
This commit is contained in:
tychovrahe 2024-05-23 13:42:35 +02:00 committed by TychoVrahe
parent 5f30194a34
commit 288c855868

View File

@ -375,7 +375,7 @@ pub trait Canvas: BasicCanvas {
// Draws circle with the specified center and the radius. // Draws circle with the specified center and the radius.
#[cfg(not(feature = "ui_antialiasing"))] #[cfg(not(feature = "ui_antialiasing"))]
fn draw_circle(&mut self, center: Point, radius: i16, color: Color, alpha: u8) { fn draw_circle(&mut self, center: Point, radius: i16, color: Color, alpha: u8) {
if radius == 0 { if radius <= 0 {
return; return;
} }
@ -441,7 +441,7 @@ pub trait Canvas: BasicCanvas {
/// Draws filled circle with the specified center and the radius. /// Draws filled circle with the specified center and the radius.
#[cfg(not(feature = "ui_antialiasing"))] #[cfg(not(feature = "ui_antialiasing"))]
fn fill_circle(&mut self, center: Point, radius: i16, color: Color, alpha: u8) { fn fill_circle(&mut self, center: Point, radius: i16, color: Color, alpha: u8) {
if radius == 0 { if radius <= 0 {
return; return;
} }
@ -508,7 +508,7 @@ pub trait Canvas: BasicCanvas {
/// radius. /// radius.
#[cfg(feature = "ui_antialiasing")] #[cfg(feature = "ui_antialiasing")]
fn fill_circle(&mut self, center: Point, radius: i16, color: Color, alpha: u8) { fn fill_circle(&mut self, center: Point, radius: i16, color: Color, alpha: u8) {
if radius == 0 { if radius <= 0 {
return; return;
} }
@ -602,7 +602,7 @@ pub trait Canvas: BasicCanvas {
mut end: f32, mut end: f32,
color: Color, color: Color,
) { ) {
if radius == 0 { if radius <= 0 {
return; return;
} }
@ -731,7 +731,7 @@ fn fill_octant(
mut u2: i16, mut u2: i16,
fill: &mut impl FnMut(Option<Point>, u8, Point, u8), fill: &mut impl FnMut(Option<Point>, u8, Point, u8),
) { ) {
if radius == 0 { if radius <= 0 {
return; return;
} }