mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[python] matplotlib: PlotView: rectangle are always visible despite the
pixel width
This commit is contained in:
@@ -52,11 +52,12 @@ void PlotView::traceSegment(KDContext * ctx, KDRect r, PlotStore::Segment segmen
|
||||
}
|
||||
}
|
||||
|
||||
static inline KDCoordinate maxKDCoordinate(KDCoordinate x, KDCoordinate y) { return x > y ? x : y; }
|
||||
void PlotView::traceRect(KDContext * ctx, KDRect r, PlotStore::Rect rect) const {
|
||||
KDRect pixelRect(
|
||||
floatToPixel(Axis::Horizontal, rect.x()),
|
||||
floatToPixel(Axis::Vertical, rect.y()),
|
||||
rect.width() / pixelWidth(),
|
||||
maxKDCoordinate(rect.width() / pixelWidth(), 1), // Rectangle should at least be visible
|
||||
rect.height() / pixelHeight()
|
||||
);
|
||||
ctx->fillRect(pixelRect, rect.color());
|
||||
|
||||
Reference in New Issue
Block a user