diff --git a/TODO b/TODO index 4d03b12..c37dfb3 100644 --- a/TODO +++ b/TODO @@ -16,7 +16,6 @@ Technology Preview 2 : - Fix the distorted sun appearance. - Improve curve editor. => Add curve modes - => Improve curve rendering => Add axis labels and grid => Add logarithmic mode - Improve 3d explorer diff --git a/gui_qt/inputcurve.cpp b/gui_qt/inputcurve.cpp index cc38bb3..32f6150 100644 --- a/gui_qt/inputcurve.cpp +++ b/gui_qt/inputcurve.cpp @@ -27,7 +27,7 @@ public: QPainter painter(this); int width = this->width(); int height = this->height(); - double position, value; + double position, value, prev_value, next_value; painter.fillRect(rect(), QColor(255, 255, 255)); for (int x = 0; x < width; x++) @@ -35,6 +35,10 @@ public: painter.setPen(QColor(0, 0, 0)); position = _xmin + (_xmax - _xmin) * (double)x / (double)(width - 1); value = (curveGetValue(_curve, position) - _ymin) * (_ymax - _ymin); + prev_value = curveGetValue(_curve, position - 1.0 / (double)(width - 1)); + next_value = curveGetValue(_curve, position + 1.0 / (double)(width - 1)); + + painter.drawLine(x, height - 1 - (int)((value + (prev_value - value) / 2.0) * (double)(height - 1)), x, height - 1 - (int)((value + (next_value - value) / 2.0) * (double)(height - 1))); painter.drawPoint(x, height - 1 - (int)(value * (double)(height - 1))); } } diff --git a/gui_qt/widgetcurveeditor.cpp b/gui_qt/widgetcurveeditor.cpp index fdb6023..31cc085 100644 --- a/gui_qt/widgetcurveeditor.cpp +++ b/gui_qt/widgetcurveeditor.cpp @@ -41,7 +41,7 @@ void WidgetCurveEditor::paintEvent(QPaintEvent* event) int width, height; double dwidth, dheight; CurvePoint point; - double position, value; + double position, value, prev_value, next_value; width = this->width(); height = this->height(); @@ -55,7 +55,12 @@ void WidgetCurveEditor::paintEvent(QPaintEvent* event) for (int x = 0; x < width; x++) { position = ((double)x) / dwidth; + value = curveGetValue(_curve, position); + prev_value = curveGetValue(_curve, position - 1.0 / dwidth); + next_value = curveGetValue(_curve, position + 1.0 / dwidth); + + painter.drawLine(x, height - 1 - (int)((value + (prev_value - value) / 2.0) * dheight), x, height - 1 - (int)((value + (next_value - value) / 2.0) * dheight)); painter.drawPoint(x, height - 1 - (int)(value * dheight)); } diff --git a/i18n/paysages_fr.ts b/i18n/paysages_fr.ts index 9c8ebea..e9ba179 100644 --- a/i18n/paysages_fr.ts +++ b/i18n/paysages_fr.ts @@ -850,7 +850,7 @@ Maintenir Ctrl : Plus rapide InputCurve - + Edit Editer