mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[python] WIP matplotlib: avoid empty pixel line between bars and axis
line
This commit is contained in:
@@ -57,8 +57,10 @@ void PlotView::traceRect(KDContext * ctx, KDRect r, PlotStore::Rect rect) const
|
||||
KDRect pixelRect(
|
||||
std::round(floatToPixel(Axis::Horizontal, rect.x())),
|
||||
std::round(floatToPixel(Axis::Vertical, rect.y())),
|
||||
maxKDCoordinate(std::round(rect.width() / pixelWidth()), 1), // Rectangle should at least be visible
|
||||
std::round(rect.height() / pixelHeight())
|
||||
// Use std::ceil instead of std::round to avoid empty pixel line between bars and horizontal axis line
|
||||
// TODO: change stored rectangles to keep all summits?
|
||||
maxKDCoordinate(std::ceil(rect.width() / pixelWidth()), 1), // Rectangle should at least be visible
|
||||
std::ceil(rect.height() / pixelHeight())
|
||||
);
|
||||
ctx->fillRect(pixelRect, rect.color());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user