Smooth curve (don't round double to int)

This commit is contained in:
Paul Dicker
2025-04-23 18:25:35 +02:00
committed by Stéphane Lesimple
parent aa00ac9e3e
commit 235a6243d2
2 changed files with 4 additions and 3 deletions

View File

@@ -110,7 +110,7 @@ int GuiCurveLX(Curve *curve, gdouble x)
return 1 + curve->leftX + (x * width) / (gdouble)curve->maxX;
}
int GuiCurveY(Curve *curve, gdouble y)
gdouble GuiCurveY(Curve *curve, gdouble y)
{ gdouble hfact;
hfact = (gdouble)(curve->bottomY - curve->topY)
@@ -380,7 +380,8 @@ void GuiRedrawAxes(cairo_t *cr, Curve *curve)
*/
void GuiRedrawCurve(cairo_t *cr, Curve *curve, int last)
{ int i,x0,x1,fy0;
{ int i,x0,x1;
gdouble fy0;
gdk_cairo_set_source_rgba(cr, Closure->curveColor);
cairo_set_line_width(cr, 1.0);

View File

@@ -690,7 +690,7 @@ void GuiFreeCurve(Curve*);
void GuiUpdateCurveGeometry(Curve*, char*, int);
int GuiCurveX(Curve*, gdouble);
int GuiCurveY(Curve*, gdouble);
gdouble GuiCurveY(Curve*, gdouble);
int GuiCurveLogY(Curve*, gdouble);
void GuiRedrawAxes(cairo_t *cr, Curve*);