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 | |
| 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')
| -rw-r--r-- | src/display/drawing-text.cpp | 2 | ||||
| -rw-r--r-- | src/filters/blend.cpp | 4 | ||||
| -rw-r--r-- | src/inkscape.cpp | 2 | ||||
| -rw-r--r-- | src/libnrtype/FontFactory.cpp | 4 | ||||
| -rw-r--r-- | src/livarot/PathOutline.cpp | 2 | ||||
| -rw-r--r-- | src/sp-lpe-item.cpp | 3 | ||||
| -rw-r--r-- | src/sp-mesh-array.cpp | 11 | ||||
| -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 | ||||
| -rw-r--r-- | src/verbs.cpp | 2 |
13 files changed, 43 insertions, 32 deletions
diff --git a/src/display/drawing-text.cpp b/src/display/drawing-text.cpp index f0d83abfd..a0918e9f5 100644 --- a/src/display/drawing-text.cpp +++ b/src/display/drawing-text.cpp @@ -269,7 +269,7 @@ void DrawingText::decorateStyle(DrawingContext &dc, double vextent, double xphas int dashes[16]={ 8, 7, 6, 5, 4, 3, 2, 1, - -8, -7, -6, -5 + -8, -7, -6, -5, -4, -3, -2, -1 }; int dots[16]={ diff --git a/src/filters/blend.cpp b/src/filters/blend.cpp index 0c7f87542..9ef544828 100644 --- a/src/filters/blend.cpp +++ b/src/filters/blend.cpp @@ -78,7 +78,7 @@ static Inkscape::Filters::FilterBlendMode sp_feBlend_readmode(gchar const *value case 's': if (strncmp(value, "screen", 6) == 0) return Inkscape::Filters::BLEND_SCREEN; - if (strncmp(value, "saturation", 6) == 0) + if (strncmp(value, "saturation", 10) == 0) return Inkscape::Filters::BLEND_SATURATION; break; case 'd': @@ -106,7 +106,7 @@ static Inkscape::Filters::FilterBlendMode sp_feBlend_readmode(gchar const *value return Inkscape::Filters::BLEND_COLOR; break; case 'h': - if (strncmp(value, "hard-light", 7) == 0) + if (strncmp(value, "hard-light", 10) == 0) return Inkscape::Filters::BLEND_HARDLIGHT; if (strncmp(value, "hue", 3) == 0) return Inkscape::Filters::BLEND_HUE; diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 48b921752..6f8ea4324 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -656,6 +656,7 @@ Application::crash_handler (int /*signum*/) repr = doc->getReprRoot(); if (doc->isModifiedSinceSave()) { const gchar *docname; + char n[64]; /* originally, the document name was retrieved from * the sodipod:docname attribute */ @@ -671,7 +672,6 @@ Application::crash_handler (int /*signum*/) if (*d=='.') dots++; } if (*d=='.' && d>docname && dots==2) { - char n[64]; size_t len = MIN (d - docname, 63); memcpy (n, docname, len); n[len] = '\0'; diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index 65eb62dda..35d584840 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -702,8 +702,8 @@ font_instance *font_factory::Face(PangoFontDescription *descr, bool canFail) PangoOTTag* features = pango_ot_info_list_features( info, PANGO_OT_TABLE_GSUB, 0, i, j ); - if( features[0] != 0 ) - // std::cout << " features: " << std::endl; + // if( features[0] != 0 ) + // std::cout << " features: " << std::endl; for( unsigned k = 0; features[k] != 0; ++k ) { // dump_tag( &features[k], " feature: "); diff --git a/src/livarot/PathOutline.cpp b/src/livarot/PathOutline.cpp index 1c42301da..0683d8ae8 100644 --- a/src/livarot/PathOutline.cpp +++ b/src/livarot/PathOutline.cpp @@ -1195,7 +1195,7 @@ Path::OutlineJoin (Path * dest, Geom::Point pos, Geom::Point stNor, Geom::Point if ((dest->descr_cmd[dest->descr_cmd.size() - 1]->getType() == descr_lineto) && (nType == descr_lineto)) { Geom::Point const biss = unit_vector(Geom::rot90( stNor - enNor )); double c2 = Geom::dot (biss, enNor); - if (fabs(c2) > 0.707107) { // apply only to obtuse angles + if (fabs(c2) > M_SQRT1_2) { // apply only to obtuse angles double l = width / c2; PathDescrLineTo* nLine = dynamic_cast<PathDescrLineTo*>(dest->descr_cmd[dest->descr_cmd.size() - 1]); nLine->p = pos + l*biss; // relocate to bisector diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index d9e53fbc5..44dc684c9 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -201,9 +201,6 @@ Inkscape::XML::Node* SPLPEItem::write(Inkscape::XML::Document *xml_doc, Inkscape * returns true when LPE was successful. */ bool SPLPEItem::performPathEffect(SPCurve *curve, bool is_clip_or_mask) { - if (!this) { - return false; - } if (!curve) { return false; diff --git a/src/sp-mesh-array.cpp b/src/sp-mesh-array.cpp index 6bd5c85d7..0dd89ac96 100644 --- a/src/sp-mesh-array.cpp +++ b/src/sp-mesh-array.cpp @@ -1046,11 +1046,12 @@ void SPMeshNodeArray::create( SPMesh *mg, SPItem *item, Geom::OptRect bbox ) { if( !bbox ) { // Set default size to bounding box if size not given. std::cout << "SPMeshNodeArray::create(): bbox empty" << std::endl; - Geom::OptRect bbox = item->geometricBounds(); - } - if( !bbox ) { - std::cout << "SPMeshNodeArray::create: ERROR: No bounding box!" << std::endl; - return; + bbox = item->geometricBounds(); + + if( !bbox ) { + std::cout << "SPMeshNodeArray::create: ERROR: No bounding box!" << std::endl; + return; + } } Geom::Coord const width = bbox->dimensions()[Geom::X]; 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")); diff --git a/src/verbs.cpp b/src/verbs.cpp index f80281870..4e76bd090 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1842,7 +1842,7 @@ void ZoomVerb::perform(SPAction *action, void *data) Inkscape::Preferences *prefs = Inkscape::Preferences::get(); gdouble zoom_inc = - prefs->getDoubleLimited( "/options/zoomincrement/value", 1.414213562, 1.01, 10 ); + prefs->getDoubleLimited( "/options/zoomincrement/value", M_SQRT2, 1.01, 10 ); double zcorr = 1.0; Glib::ustring abbr = prefs->getString("/options/zoomcorrection/unit"); |
