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);
}
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 {
// Very thin - approximate by a horizontal line-segment:
let line = [rect.left_center(), rect.right_center()];
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() {
self.tessellate_line(line, stroke, out);
self.tessellate_line(line, stroke, out); // back…
self.tessellate_line(line, stroke, out); // …and forth
}
} else {
let path = &mut self.scratchpad_path;