Fix newly introduced rendering bug for thin rectangles

This commit is contained in:
Emil Ernerfeldt 2022-12-19 11:31:27 +01:00
parent 7e9c7dac41
commit e4e1638fc0

View file

@ -1316,16 +1316,18 @@ impl Tessellator {
self.tessellate_line(line, Stroke::new(rect.width(), fill), out); self.tessellate_line(line, Stroke::new(rect.width(), fill), out);
} }
if !stroke.is_empty() { if !stroke.is_empty() {
self.tessellate_line(line, stroke, out); self.tessellate_line(line, stroke, out); // back…
self.tessellate_line(line, stroke, out); // …and forth
} }
} else if rect.height() < self.feathering { } else if rect.height() < self.feathering {
// Very thin - approximate by a horizontal line-segment: // Very thin - approximate by a horizontal line-segment:
let line = [rect.left_center(), rect.right_center()]; let line = [rect.left_center(), rect.right_center()];
if fill != Color32::TRANSPARENT { if fill != Color32::TRANSPARENT {
self.tessellate_line(line, Stroke::new(rect.width(), fill), out); self.tessellate_line(line, Stroke::new(rect.height(), fill), out);
} }
if !stroke.is_empty() { if !stroke.is_empty() {
self.tessellate_line(line, stroke, out); self.tessellate_line(line, stroke, out); // back…
self.tessellate_line(line, stroke, out); // …and forth
} }
} else { } else {
let path = &mut self.scratchpad_path; let path = &mut self.scratchpad_path;