mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[app/shared] CurveView: simplify implementation of
pixelLengthToFloatLength (avoid avoidable overflows)
This commit is contained in:
@@ -155,8 +155,7 @@ float CurveView::floatLengthToPixelLength(float dx, float dy) const {
|
||||
}
|
||||
|
||||
float CurveView::pixelLengthToFloatLength(Axis axis, float f) const {
|
||||
f = axis == Axis::Vertical ? -f : f;
|
||||
return pixelToFloat(axis, floatToPixel(axis, 0.0f) + f);
|
||||
return f*pixelLength(axis);
|
||||
}
|
||||
|
||||
void CurveView::drawGridLines(KDContext * ctx, KDRect rect, Axis axis, float step, KDColor boldColor, KDColor lightColor) const {
|
||||
|
||||
Reference in New Issue
Block a user