fixup! feat(core): introduce new drawing library

cepetr/gfx-alpha
cepetr 4 weeks ago
parent bd52d63ec0
commit 7105c4caa8

@ -424,76 +424,6 @@ pub trait Canvas: BasicCanvas {
}
}
/// Draws antialiased circle with the specified center and the radius.
/*#[cfg(feature = "ui_antialiasing")]
fn draw_circle(&mut self, center: Point, radius: i16, color: Color) {
let split = unwrap!(circle_points(radius).last()).v;
let r = Rect::new(
Point::new(center.x - radius, center.y - radius),
Point::new(center.x + radius + 1, center.y - split + 1),
);
if self.viewport().contains(r) {
for p in circle_points(radius) {
let pt_l = Point::new(center.x - p.u, center.y - p.v);
self.blend_pixel(pt_l, color, p.frac);
self.blend_pixel(pt_l.under(), color, 255 - p.frac);
let pt_r = Point::new(center.x + p.u, center.y - p.v);
self.blend_pixel(pt_r, color, p.frac);
self.blend_pixel(pt_r.under(), color, 255 - p.frac);
}
}
let r = Rect::new(
Point::new(center.x - radius, center.y - split),
Point::new(center.x + radius + 1, center.y + 1),
);
if self.viewport().contains(r) {
for p in circle_points(radius).take_while(|p| p.u < p.v) {
let pt_l = Point::new(center.x - p.v, center.y - p.u);
self.blend_pixel(pt_l, color, p.frac);
self.blend_pixel(pt_l.onright(), color, 255 - p.frac);
let pt_r = Point::new(center.x + p.v, center.y - p.u);
self.blend_pixel(pt_r, color, p.frac);
self.blend_pixel(pt_r.onleft(), color, 255 - p.frac);
}
}
let r = Rect::new(
Point::new(center.x - radius, center.y + 1),
Point::new(center.x + radius + 1, center.y + split + 1),
);
if self.viewport().contains(r) {
for p in circle_points(radius).skip(1).take_while(|p| p.u < p.v) {
let pt_l = Point::new(center.x - p.v, center.y + p.u);
self.blend_pixel(pt_l, color, p.frac);
self.blend_pixel(pt_l.onright(), color, 255 - p.frac);
let pt_r = Point::new(center.x + p.v, center.y + p.u);
self.blend_pixel(pt_r, color, p.frac);
self.blend_pixel(pt_r.onleft(), color, 255 - p.frac);
}
}
let r = Rect::new(
Point::new(center.x - radius, center.y + split),
Point::new(center.x + radius + 1, center.y + radius + 1),
);
if self.viewport().contains(r) {
for p in circle_points(radius) {
let pt_l = Point::new(center.x - p.u, center.y + p.v);
self.blend_pixel(pt_l, color, p.frac);
self.blend_pixel(pt_l.above(), color, 255 - p.frac);
let pt_r = Point::new(center.x + p.u, center.y + p.v);
self.blend_pixel(pt_r, color, p.frac);
self.blend_pixel(pt_r.above(), color, 255 - p.frac);
}
}
}*/
/// Draws filled circle with the specified center and the radius.
#[cfg(not(feature = "ui_antialiasing"))]
fn fill_circle(&mut self, center: Point, radius: i16, color: Color) {

Loading…
Cancel
Save