summaryrefslogtreecommitdiffhomepage
path: root/spline-widget/spline-widget.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-16 17:31:04 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-16 17:53:40 +0200
commit6200fa9bb156ad02e7c6055c8dbd92f8c9a10759 (patch)
tree0f770a8c4800fffc30c69c0a4b010bf77e0dd51d /spline-widget/spline-widget.hpp
parent7868302f5611606883e5eddd640ee806bf192481 (diff)
spline-widget: simplify/fix drawing logic
The linear things should be drawn in drawFunction() since they change only when some control point is moved and the spline is recalculated anyway. Introduce spline::get_value_no_save to avoid clobbering the tracked value. Draw linear helper before the spline to avoid occluding it. Remove some redundant checks for whether _config exists when all calling sites ensure it already. I still need to de-camel-case these two classes.
Diffstat (limited to 'spline-widget/spline-widget.hpp')
-rw-r--r--spline-widget/spline-widget.hpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/spline-widget/spline-widget.hpp b/spline-widget/spline-widget.hpp
index 477e3ba6..d94d2e8e 100644
--- a/spline-widget/spline-widget.hpp
+++ b/spline-widget/spline-widget.hpp
@@ -39,23 +39,12 @@ public:
~spline_widget();
spline* config();
-
void setConfig(spline* spl);
- QColor colorBezier() const
- {
- return spline_color;
- }
- void setColorBezier(QColor color)
- {
- spline_color = color;
- update();
- }
- void force_redraw()
- {
- _background = QPixmap();
- update();
- }
+ QColor colorBezier() const;
+ void setColorBezier(QColor color);
+
+ void force_redraw();
void set_preview_only(bool val);
bool is_preview_only() const;
void set_snap(double x, double y) { snap_x = x; snap_y = y; }