diff options
| author | kamalpreetgrewal <grewalkamal005@gmail.com> | 2016-08-16 15:26:20 +0000 |
|---|---|---|
| committer | kamalpreetgrewal <grewalkamal005@gmail.com> | 2016-08-16 15:26:20 +0000 |
| commit | d242b8e3362e0a87c40177309a1141031d8d01f9 (patch) | |
| tree | 60795f1e5fdb8799fe57b9e189259dd2992e366a /src/ui | |
| parent | Add changes for compilation with trunk (diff) | |
| parent | Add Shift+drag to arc start and end knots, holding shift will now move both k... (diff) | |
| download | inkscape-d242b8e3362e0a87c40177309a1141031d8d01f9.tar.gz inkscape-d242b8e3362e0a87c40177309a1141031d8d01f9.zip | |
Merge changes from trunk
(bzr r14949.1.66)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/svg-fonts-dialog.cpp | 4 | ||||
| -rw-r--r-- | src/ui/object-edit.cpp | 35 | ||||
| -rw-r--r-- | src/ui/widget/font-variants.cpp | 2 | ||||
| -rw-r--r-- | src/ui/widget/page-sizer.cpp | 2 |
5 files changed, 29 insertions, 16 deletions
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 4574e93fe..9a95c3d8c 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1307,7 +1307,7 @@ void InkscapePreferences::initPageBehavior() _steps_rot_relative.init ( _("Relative snapping of guideline angles"), "/options/relativeguiderotationsnap/value", false); _page_steps.add_line( false, "", _steps_rot_relative, "", _("When on, the snap angles when rotating a guideline will be relative to the original angle")); - _steps_zoom.init ( "/options/zoomincrement/value", 101.0, 500.0, 1.0, 1.0, 1.414213562, true, true); + _steps_zoom.init ( "/options/zoomincrement/value", 101.0, 500.0, 1.0, 1.0, M_SQRT2, true, true); _page_steps.add_line( false, _("_Zoom in/out by:"), _steps_zoom, _("%"), _("Zoom tool click, +/- keys, and middle click zoom in and out by this multiplier"), false); this->AddPage(_page_steps, _("Steps"), iter_behavior, PREFS_PAGE_BEHAVIOR_STEPS); diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 6a87f3714..0203d9778 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -162,10 +162,8 @@ GlyphComboBox::GlyphComboBox(){ } void GlyphComboBox::update(SPFont* spfont){ - if (!spfont) return -//TODO: figure out why do we need to append("") before clearing items properly... + if (!spfont) return; - this->append(""); //Gtk is refusing to clear the combobox when I comment out this line this->remove_all(); for (auto& node: spfont->children) { diff --git a/src/ui/object-edit.cpp b/src/ui/object-edit.cpp index ddf770f59..2763e6c4b 100644 --- a/src/ui/object-edit.cpp +++ b/src/ui/object-edit.cpp @@ -795,8 +795,11 @@ sp_genericellipse_side(SPGenericEllipse *ellipse, Geom::Point const &p) gdouble dy = (p[Geom::Y] - ellipse->cy.computed) / ellipse->ry.computed; gdouble s = dx * dx + dy * dy; - if (s < 1.0) return 1; - if (s > 1.0) return -1; + // We add a bit of a buffer, so there's a decent chance the user will + // be able to adjust the arc without the closed status flipping between + // open and closed during micro mouse movements. + if (s < 0.75) return 1; + if (s > 1.25) return -1; return 0; } @@ -808,16 +811,21 @@ ArcKnotHolderEntityStart::knot_set(Geom::Point const &p, Geom::Point const &/*or SPGenericEllipse *arc = dynamic_cast<SPGenericEllipse *>(item); g_assert(arc != NULL); - arc->setClosed(sp_genericellipse_side(arc, p) == -1); + gint side = sp_genericellipse_side(arc, p); + if(side != 0) { arc->setClosed(side == -1); } Geom::Point delta = p - Geom::Point(arc->cx.computed, arc->cy.computed); Geom::Scale sc(arc->rx.computed, arc->ry.computed); - arc->start = atan2(delta * sc.inverse()); + double offset = arc->start - atan2(delta * sc.inverse()); + arc->start -= offset; if ((state & GDK_CONTROL_MASK) && snaps) { arc->start = sp_round(arc->start, M_PI / snaps); } + if (state & GDK_SHIFT_MASK) { + arc->end -= offset; + } arc->normalize(); arc->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); @@ -852,16 +860,21 @@ ArcKnotHolderEntityEnd::knot_set(Geom::Point const &p, Geom::Point const &/*orig SPGenericEllipse *arc = dynamic_cast<SPGenericEllipse *>(item); g_assert(arc != NULL); - arc->setClosed(sp_genericellipse_side(arc, p) == -1); + gint side = sp_genericellipse_side(arc, p); + if(side != 0) { arc->setClosed(side == -1); } Geom::Point delta = p - Geom::Point(arc->cx.computed, arc->cy.computed); Geom::Scale sc(arc->rx.computed, arc->ry.computed); - arc->end = atan2(delta * sc.inverse()); + double offset = arc->end - atan2(delta * sc.inverse()); + arc->end -= offset; if ((state & GDK_CONTROL_MASK) && snaps) { arc->end = sp_round(arc->end, M_PI/snaps); } + if (state & GDK_SHIFT_MASK) { + arc->start -= offset; + } arc->normalize(); arc->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); @@ -983,13 +996,15 @@ ArcKnotHolder::ArcKnotHolder(SPDesktop *desktop, SPItem *item, SPKnotHolderRelea SP_KNOT_SHAPE_SQUARE, SP_KNOT_MODE_XOR); entity_start->create(desktop, item, this, Inkscape::CTRL_TYPE_ROTATE, - _("Position the <b>start point</b> of the arc or segment; with <b>Ctrl</b> " - "to snap angle; drag <b>inside</b> the ellipse for arc, <b>outside</b> for segment"), + _("Position the <b>start point</b> of the arc or segment; with <b>Shift</b> to move " + "with <b>end point</b>; with <b>Ctrl</b> to snap angle; drag <b>inside</b> the " + "ellipse for arc, <b>outside</b> for segment"), SP_KNOT_SHAPE_CIRCLE, SP_KNOT_MODE_XOR); entity_end->create(desktop, item, this, Inkscape::CTRL_TYPE_ROTATE, - _("Position the <b>end point</b> of the arc or segment; with <b>Ctrl</b> to snap angle; " - "drag <b>inside</b> the ellipse for arc, <b>outside</b> for segment"), + _("Position the <b>end point</b> of the arc or segment; with <b>Shift</b> to move " + "with <b>start point</b>; with <b>Ctrl</b> to snap angle; drag <b>inside</b> the " + "ellipse for arc, <b>outside</b> for segment"), SP_KNOT_SHAPE_CIRCLE, SP_KNOT_MODE_XOR); entity.push_back(entity_rx); diff --git a/src/ui/widget/font-variants.cpp b/src/ui/widget/font-variants.cpp index aca85f246..b386051a6 100644 --- a/src/ui/widget/font-variants.cpp +++ b/src/ui/widget/font-variants.cpp @@ -629,7 +629,7 @@ namespace Widget { } else if( _caps_all_small.get_active() ) { css_string = "all-small-caps"; caps_new = SP_CSS_FONT_VARIANT_CAPS_ALL_SMALL; - } else if( _caps_all_petite.get_active() ) { + } else if( _caps_petite.get_active() ) { css_string = "petite"; caps_new = SP_CSS_FONT_VARIANT_CAPS_PETITE; } else if( _caps_all_petite.get_active() ) { diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index 578b6855a..081300b9e 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -406,7 +406,7 @@ PageSizer::PageSizer(Registry & _wr) _fitPageButtonAlign.set(0.5, 0.5, 0.0, 1.0); _fitPageButtonAlign.add(_fitPageButton); _fitPageButton.set_use_underline(); - _fitPageButton.set_label(_("_Resize page to drawing or selection")); + _fitPageButton.set_label(_("_Resize page to drawing or selection (Ctrl+Shift+R)")); _fitPageButton.set_tooltip_text(_("Resize the page to fit the current selection, or the entire drawing if there is no selection")); _scaleFrame.set_label(_("Scale")); |
