Merge lp:~dasprid/inkscape/inkscape-dasprid into lp:~inkscape.dev/inkscape/trunk

Proposed by Ben Scholzen 'DASPRiD'
Status: Merged
Merged at revision: 14173
Proposed branch: lp:~dasprid/inkscape/inkscape-dasprid
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 153 lines (+25/-28)
5 files modified
src/live_effects/parameter/parameter.cpp (+0/-7)
src/live_effects/parameter/parameter.h (+7/-0)
src/ui/dialog/lpe-fillet-chamfer-properties.cpp (+3/-2)
src/ui/dialog/lpe-powerstroke-properties.cpp (+12/-8)
src/ui/dialog/lpe-powerstroke-properties.h (+3/-11)
To merge this branch: bzr merge lp:~dasprid/inkscape/inkscape-dasprid
Reviewer Review Type Date Requested Status
Liam P. White (community) Approve
Review via email: mp+259663@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Liam P. White (liampwhite) wrote :

Looks fine

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/live_effects/parameter/parameter.cpp'
2--- src/live_effects/parameter/parameter.cpp 2014-11-01 15:18:51 +0000
3+++ src/live_effects/parameter/parameter.cpp 2015-05-20 18:32:16 +0000
4@@ -42,13 +42,6 @@
5 param_effect->getRepr()->setAttribute(param_key.c_str(), svgd);
6 }
7
8-// In gtk2, this wasn't an issue; we could toss around
9-// G_MAXDOUBLE and not worry about size allocations. But
10-// in gtk3, it is an issue: it allocates widget size for the maxmium
11-// value you pass to it, leading to some insane lengths.
12-// If you need this to be more, please be conservative about it.
13-const double SCALARPARAM_G_MAXDOUBLE = 10000000000.0; // TODO fixme: using an arbitrary large number as a magic value seems fragile.
14-
15 void Parameter::write_to_SVG(void)
16 {
17 gchar * str = param_getSVGValue();
18
19=== modified file 'src/live_effects/parameter/parameter.h'
20--- src/live_effects/parameter/parameter.h 2014-08-15 13:14:32 +0000
21+++ src/live_effects/parameter/parameter.h 2015-05-20 18:32:16 +0000
22@@ -13,6 +13,13 @@
23 #include <2geom/forward.h>
24 #include <2geom/pathvector.h>
25
26+// In gtk2, this wasn't an issue; we could toss around
27+// G_MAXDOUBLE and not worry about size allocations. But
28+// in gtk3, it is an issue: it allocates widget size for the maxmium
29+// value you pass to it, leading to some insane lengths.
30+// If you need this to be more, please be conservative about it.
31+const double SCALARPARAM_G_MAXDOUBLE = 10000000000.0; // TODO fixme: using an arbitrary large number as a magic value seems fragile.
32+
33 class KnotHolder;
34 class SPLPEItem;
35 class SPDesktop;
36
37=== modified file 'src/ui/dialog/lpe-fillet-chamfer-properties.cpp'
38--- src/ui/dialog/lpe-fillet-chamfer-properties.cpp 2015-05-09 15:50:08 +0000
39+++ src/ui/dialog/lpe-fillet-chamfer-properties.cpp 2015-05-20 18:32:16 +0000
40@@ -27,6 +27,7 @@
41 #include "selection-chemistry.h"
42 #include "ui/icon-names.h"
43 #include "ui/widget/imagetoggler.h"
44+#include "live_effects/parameter/parameter.h"
45 #include <cmath>
46
47 //#include "event-context.h"
48@@ -47,7 +48,7 @@
49 _fillet_chamfer_position_numeric.set_digits(4);
50 _fillet_chamfer_position_numeric.set_increments(1,1);
51 //todo: get tha max aloable infinity freeze the widget
52- _fillet_chamfer_position_numeric.set_range(0., 999999999999999999.);
53+ _fillet_chamfer_position_numeric.set_range(0., SCALARPARAM_G_MAXDOUBLE);
54
55 _fillet_chamfer_position_label.set_label(_("Radius (pixels):"));
56 _fillet_chamfer_position_label.set_alignment(1.0, 0.5);
57@@ -59,7 +60,7 @@
58 _fillet_chamfer_chamfer_subdivisions.set_digits(0);
59 _fillet_chamfer_chamfer_subdivisions.set_increments(1,1);
60 //todo: get tha max aloable infinity freeze the widget
61- _fillet_chamfer_chamfer_subdivisions.set_range(0, 999999999999999999.0);
62+ _fillet_chamfer_chamfer_subdivisions.set_range(0, SCALARPARAM_G_MAXDOUBLE);
63
64 _fillet_chamfer_chamfer_subdivisions_label.set_label(_("Chamfer subdivisions:"));
65 _fillet_chamfer_chamfer_subdivisions_label.set_alignment(1.0, 0.5);
66
67=== modified file 'src/ui/dialog/lpe-powerstroke-properties.cpp'
68--- src/ui/dialog/lpe-powerstroke-properties.cpp 2015-04-27 23:38:31 +0000
69+++ src/ui/dialog/lpe-powerstroke-properties.cpp 2015-05-20 18:32:16 +0000
70@@ -36,6 +36,7 @@
71 #include "selection-chemistry.h"
72 #include "ui/icon-names.h"
73 #include "ui/widget/imagetoggler.h"
74+#include "live_effects/parameter/parameter.h"
75 //#include "event-context.h"
76
77 namespace Inkscape {
78@@ -52,10 +53,16 @@
79
80 // Layer name widgets
81 _powerstroke_position_entry.set_activates_default(true);
82+ _powerstroke_position_entry.set_digits(4);
83+ _powerstroke_position_entry.set_increments(1,1);
84+ _powerstroke_position_entry.set_range(-SCALARPARAM_G_MAXDOUBLE, SCALARPARAM_G_MAXDOUBLE);
85 _powerstroke_position_label.set_label(_("Position:"));
86 _powerstroke_position_label.set_alignment(1.0, 0.5);
87
88 _powerstroke_width_entry.set_activates_default(true);
89+ _powerstroke_width_entry.set_digits(4);
90+ _powerstroke_width_entry.set_increments(1,1);
91+ _powerstroke_width_entry.set_range(-SCALARPARAM_G_MAXDOUBLE, SCALARPARAM_G_MAXDOUBLE);
92 _powerstroke_width_label.set_label(_("Width:"));
93 _powerstroke_width_label.set_alignment(1.0, 0.5);
94
95@@ -126,12 +133,9 @@
96 void
97 PowerstrokePropertiesDialog::_apply()
98 {
99- std::istringstream i_pos(_powerstroke_position_entry.get_text());
100- std::istringstream i_width(_powerstroke_width_entry.get_text());
101- double d_pos, d_width;
102- if ((i_pos >> d_pos) && i_width >> d_width) {
103- _knotpoint->knot_set_offset(Geom::Point(d_pos, d_width));
104- }
105+ double d_pos = _powerstroke_position_entry.get_value();
106+ double d_width = _powerstroke_width_entry.get_value();
107+ _knotpoint->knot_set_offset(Geom::Point(d_pos, d_width));
108 _close();
109 }
110
111@@ -171,8 +175,8 @@
112
113 void PowerstrokePropertiesDialog::_setKnotPoint(Geom::Point knotpoint)
114 {
115- _powerstroke_position_entry.set_text(boost::lexical_cast<std::string>(knotpoint.x()));
116- _powerstroke_width_entry.set_text(boost::lexical_cast<std::string>(knotpoint.y()));
117+ _powerstroke_position_entry.set_value(knotpoint.x());
118+ _powerstroke_width_entry.set_value(knotpoint.y());
119 }
120
121 void PowerstrokePropertiesDialog::_setPt(const Inkscape::LivePathEffect::PowerStrokePointArrayParamKnotHolderEntity *pt)
122
123=== modified file 'src/ui/dialog/lpe-powerstroke-properties.h'
124--- src/ui/dialog/lpe-powerstroke-properties.h 2014-10-08 02:22:03 +0000
125+++ src/ui/dialog/lpe-powerstroke-properties.h 2015-05-20 18:32:16 +0000
126@@ -13,15 +13,7 @@
127 #define INKSCAPE_DIALOG_POWERSTROKE_PROPERTIES_H
128
129 #include <2geom/point.h>
130-#include <gtkmm/dialog.h>
131-#include <gtkmm/entry.h>
132-#include <gtkmm/label.h>
133-#include <gtkmm/table.h>
134-#include <gtkmm/combobox.h>
135-#include <gtkmm/liststore.h>
136-#include <gtkmm/treeview.h>
137-#include <gtkmm/treestore.h>
138-#include <gtkmm/scrolledwindow.h>
139+#include <gtkmm.h>
140 #include "live_effects/parameter/powerstrokepointarray.h"
141
142 class SPDesktop;
143@@ -45,9 +37,9 @@
144 Inkscape::LivePathEffect::PowerStrokePointArrayParamKnotHolderEntity *_knotpoint;
145
146 Gtk::Label _powerstroke_position_label;
147- Gtk::Entry _powerstroke_position_entry;
148+ Gtk::SpinButton _powerstroke_position_entry;
149 Gtk::Label _powerstroke_width_label;
150- Gtk::Entry _powerstroke_width_entry;
151+ Gtk::SpinButton _powerstroke_width_entry;
152 Gtk::Table _layout_table;
153 bool _position_visible;
154