diff options
| author | vanntile <valentin.ionita1201@gmail.com> | 2019-08-11 09:15:19 +0000 |
|---|---|---|
| committer | vanntile <valentin.ionita1201@gmail.com> | 2019-08-17 15:33:46 +0000 |
| commit | 863a58d272adaa3c371874e3472e7b90b57dcfb5 (patch) | |
| tree | cb098c455031b28a82ac2c1fbd2af30999f774a8 /src | |
| parent | Some useful hatch changes (diff) | |
| download | inkscape-863a58d272adaa3c371874e3472e7b90b57dcfb5.tar.gz inkscape-863a58d272adaa3c371874e3472e7b90b57dcfb5.zip | |
Formatting last commit
Diffstat (limited to 'src')
| -rw-r--r-- | src/desktop-style.cpp | 17 | ||||
| -rw-r--r-- | src/ui/clipboard.cpp | 23 | ||||
| -rw-r--r-- | src/ui/widget/selected-style.cpp | 25 | ||||
| -rw-r--r-- | src/ui/widget/selected-style.h | 10 |
4 files changed, 36 insertions, 39 deletions
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index 072a38eec..dfcc0eead 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -26,6 +26,8 @@ #include "selection.h" #include "object/box3d-side.h" +#include "object/filters/blend.h" +#include "object/filters/gaussian-blur.h" #include "object/sp-flowdiv.h" #include "object/sp-flowregion.h" #include "object/sp-flowtext.h" @@ -39,8 +41,6 @@ #include "object/sp-tspan.h" #include "object/sp-use.h" #include "style.h" -#include "object/filters/blend.h" -#include "object/filters/gaussian-blur.h" #include "svg/css-ostringstream.h" #include "svg/svg-color.h" @@ -549,8 +549,9 @@ objects_query_fillstroke (const std::vector<SPItem*> &objects, SPStyle *style_re SPLinearGradient *linear_res = dynamic_cast<SPLinearGradient *>(server_res); SPRadialGradient *radial_res = linear_res ? nullptr : dynamic_cast<SPRadialGradient *>(server_res); SPPattern *pattern_res = (linear_res || radial_res) ? nullptr : dynamic_cast<SPPattern *>(server_res); - SPHatch *hatch_res = (linear_res || radial_res || pattern_res) ? nullptr : dynamic_cast<SPHatch *>(server_res); - + SPHatch *hatch_res = + (linear_res || radial_res || pattern_res) ? nullptr : dynamic_cast<SPHatch *>(server_res); + if (linear_res) { SPLinearGradient *linear = dynamic_cast<SPLinearGradient *>(server); if (!linear) { @@ -587,13 +588,13 @@ objects_query_fillstroke (const std::vector<SPItem*> &objects, SPStyle *style_re } else if (hatch_res) { SPHatch *hatch = dynamic_cast<SPHatch *>(server); if (!hatch) { - return QUERY_STYLE_MULTIPLE_DIFFERENT; // different kind of server + return QUERY_STYLE_MULTIPLE_DIFFERENT; // different kind of server } - SPHatch *hat = SP_HATCH (server)->rootHatch(); - SPHatch *hat_res = SP_HATCH (server_res)->rootHatch(); + SPHatch *hat = SP_HATCH(server)->rootHatch(); + SPHatch *hat_res = SP_HATCH(server_res)->rootHatch(); if (hat_res != hat) { - return QUERY_STYLE_MULTIPLE_DIFFERENT; // different pattern roots + return QUERY_STYLE_MULTIPLE_DIFFERENT; // different hatch roots } } } diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index dd1679dfc..4362c2b94 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -64,8 +64,8 @@ #include "object/sp-rect.h" #include "object/sp-root.h" #include "object/sp-shape.h" -#include "object/sp-use.h" #include "object/sp-textpath.h" +#include "object/sp-use.h" #include "style.h" #include "svg/svg.h" // for sp_svg_transform_write, used in _copySelection @@ -325,9 +325,9 @@ void ClipboardManagerImpl::copySymbol(Inkscape::XML::Node* symbol, gchar const* SPObject *cmobj = _clipboardSPDoc->getObjectByRepr(repr); if (cmobj && !user_symbol) { // convert only stock symbols if (!Geom::are_near(scale_units, 1.0, Geom::EPSILON)) { - dynamic_cast<SPGroup *>(cmobj)->scaleChildItemsRec(Geom::Scale(scale_units), - Geom::Point(0, SP_ACTIVE_DESKTOP->getDocument()->getHeight().value("px")), - false); + dynamic_cast<SPGroup *>(cmobj)->scaleChildItemsRec( + Geom::Scale(scale_units), Geom::Point(0, SP_ACTIVE_DESKTOP->getDocument()->getHeight().value("px")), + false); } } @@ -822,11 +822,11 @@ void ClipboardManagerImpl::_copyUsedDefs(SPItem *item) _copyGradient(dynamic_cast<SPGradient *>(server)); } SPPattern *pattern = dynamic_cast<SPPattern *>(server); - if ( pattern ) { + if (pattern) { _copyPattern(pattern); } SPHatch *hatch = dynamic_cast<SPHatch *>(server); - if ( hatch ) { + if (hatch) { _copyHatch(hatch); } } @@ -836,11 +836,11 @@ void ClipboardManagerImpl::_copyUsedDefs(SPItem *item) _copyGradient(dynamic_cast<SPGradient *>(server)); } SPPattern *pattern = dynamic_cast<SPPattern *>(server); - if ( pattern ) { + if (pattern) { _copyPattern(pattern); } SPHatch *hatch = dynamic_cast<SPHatch *>(server); - if ( hatch ) { + if (hatch) { _copyHatch(hatch); } } @@ -976,16 +976,15 @@ void ClipboardManagerImpl::_copyHatch(SPHatch *hatch) while (hatch) { _copyNode(hatch->getRepr(), _doc, _defs); - for (auto& child: hatch->children) { + for (auto &child : hatch->children) { SPItem *childItem = dynamic_cast<SPItem *>(&child); if (childItem) { _copyUsedDefs(childItem); } } - if (hatch->ref){ + if (hatch->ref) { hatch = hatch->ref->getObject(); - } - else{ + } else { hatch = nullptr; } } diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 53ec6c1a2..6fe5f797e 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -190,10 +190,10 @@ SelectedStyle::SelectedStyle(bool /*layout*/) _pattern[i].show_all(); __pattern[i] = (i == SS_FILL)? (_("Pattern fill")) : (_("Pattern stroke")); - _hatch[i].set_markup (_("Hatch")); - sp_set_font_size_smaller (GTK_WIDGET(_hatch[i].gobj())); + _hatch[i].set_markup(_("Hatch")); + sp_set_font_size_smaller(GTK_WIDGET(_hatch[i].gobj())); _hatch[i].show_all(); - __hatch[i] = (i == SS_FILL)? (_("Hatch fill")) : (_("Hatch stroke")); + __hatch[i] = (i == SS_FILL) ? (_("Hatch fill")) : (_("Hatch stroke")); _lgradient[i].set_markup (_("<b>L</b>")); sp_set_font_size_smaller (GTK_WIDGET(_lgradient[i].gobj())); @@ -975,13 +975,13 @@ SelectedStyle::update() _paintserver_id[i] += srepr->attribute("id"); _paintserver_id[i] += ")"; - if (SP_IS_LINEARGRADIENT (server)) { + if (SP_IS_LINEARGRADIENT(server)) { SPGradient *vector = SP_GRADIENT(server)->getVector(); sp_gradient_image_set_gradient(SP_GRADIENT_IMAGE(_gradient_preview_l[i]), vector); place->add(_gradient_box_l[i]); place->set_tooltip_text(__lgradient[i]); _mode[i] = SS_LGRADIENT; - } else if (SP_IS_RADIALGRADIENT (server)) { + } else if (SP_IS_RADIALGRADIENT(server)) { SPGradient *vector = SP_GRADIENT(server)->getVector(); sp_gradient_image_set_gradient(SP_GRADIENT_IMAGE(_gradient_preview_r[i]), vector); place->add(_gradient_box_r[i]); @@ -995,14 +995,14 @@ SelectedStyle::update() place->set_tooltip_text(__mgradient[i]); _mode[i] = SS_MGRADIENT; #endif - } else if (SP_IS_PATTERN (server)) { + } else if (SP_IS_PATTERN(server)) { place->add(_pattern[i]); place->set_tooltip_text(__pattern[i]); _mode[i] = SS_PATTERN; - } else if (SP_IS_HATCH (server)) { + } else if (SP_IS_HATCH(server)) { place->add(_hatch[i]); place->set_tooltip_text(__hatch[i]); - _mode[i] == SS_HATCH; + _mode[i] = SS_HATCH; } } else { g_warning ("file %s: line %d: Unknown paint server", __FILE__, __LINE__); @@ -1294,13 +1294,12 @@ RotateableSwatch::do_motion(double by, guint modifier) { pixbuf = gdk_pixbuf_new_from_xpm_data((const gchar **)cursor_adj_h_xpm); } - if (pixbuf != nullptr) { - cr = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf, 16, 16); - + if (pixbuf != nullptr) { + cr = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf, 16, 16); g_object_unref(pixbuf); gdk_window_set_cursor(gtk_widget_get_window(w), cr); - g_object_unref(cr); - cr = nullptr; + g_object_unref(cr); + cr = nullptr; cr_set = true; } } diff --git a/src/ui/widget/selected-style.h b/src/ui/widget/selected-style.h index 5134b4ab3..388f802cf 100644 --- a/src/ui/widget/selected-style.h +++ b/src/ui/widget/selected-style.h @@ -63,9 +63,8 @@ enum { class SelectedStyle; -class RotateableSwatch: public Rotateable -{ -public: +class RotateableSwatch : public Rotateable { + public: RotateableSwatch(SelectedStyle *parent, guint mode); ~RotateableSwatch() override; @@ -89,9 +88,8 @@ private: bool cr_set; }; -class RotateableStrokeWidth: public Rotateable -{ -public: +class RotateableStrokeWidth : public Rotateable { + public: RotateableStrokeWidth(SelectedStyle *parent); ~RotateableStrokeWidth() override; |
