diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-03-17 12:29:02 +0000 |
|---|---|---|
| committer | Jabiertxo Arraiza Zenotz <jtx@jtx.marker.es> | 2013-03-17 12:29:02 +0000 |
| commit | 732618cd7d6159ee47cc0dd8b86cf07790e3e724 (patch) | |
| tree | 5e7ce92337d91b24e07f9c5f8992f1bc6478c692 /src/splivarot.cpp | |
| parent | Working in widgets (diff) | |
| download | inkscape-732618cd7d6159ee47cc0dd8b86cf07790e3e724.tar.gz inkscape-732618cd7d6159ee47cc0dd8b86cf07790e3e724.zip | |
Working with widjets
(bzr r11950.1.56)
Diffstat (limited to 'src/splivarot.cpp')
| -rw-r--r-- | src/splivarot.cpp | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/src/splivarot.cpp b/src/splivarot.cpp index 2015ffd27..061d32554 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -1369,18 +1369,48 @@ void sp_selected_path_create_offset_object(SPDesktop *desktop, int expand, bool Inkscape::XML::Node *parent = item->getRepr()->parent(); float o_width = 0; + JoinType o_join = join_straight; + ButtType o_butt = butt_straight; + float o_miter = 0; { SPStyle *i_style = item->style; + int jointype = i_style->stroke_linejoin.value; + int captype = i_style->stroke_linecap.value; o_width = i_style->stroke_width.computed; + if (jointype == SP_STROKE_LINEJOIN_MITER) + { + o_join = join_pointy; + } + else if (jointype == SP_STROKE_LINEJOIN_ROUND) + { + o_join = join_round; + } + else + { + o_join = join_straight; + } + if (captype == SP_STROKE_LINECAP_SQUARE) + { + o_butt = butt_square; + } + else if (captype == SP_STROKE_LINECAP_ROUND) + { + o_butt = butt_round; + } + else + { + o_butt = butt_straight; + } + { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); o_width = prefs->getDouble("/options/defaultoffsetwidth/value", 1.0, "px"); } - if (o_width < 0.01){ + if (o_width < 0.01) o_width = 0.01; - } + o_miter = i_style->stroke_miterlimit.value * o_width; } Path *orig = Path_for_item(item, true, false); @@ -1478,7 +1508,7 @@ void sp_selected_path_create_offset_object(SPDesktop *desktop, int expand, bool // move to the saved position repr->setPosition(pos > 0 ? pos : 0); - SPItem *nitem = reinterpret_cast<SPItem *>(sp_desktop_document(desktop)->getObjectByRepr(repr)); + SPItem *nitem = (SPItem *) sp_desktop_document(desktop)->getObjectByRepr(repr); if ( !updating ) { // delete original, apply the transform to the offset |
