diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-12-04 20:39:11 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-12-04 20:39:35 +0000 |
| commit | 85ec83bdc0d9b1c11d8789c0edbe6a46ed0db20e (patch) | |
| tree | 7950fbcc25f5c4a65747ccc088352c6bcacde1fb /src | |
| parent | Ready to review XRay (diff) | |
| download | inkscape-85ec83bdc0d9b1c11d8789c0edbe6a46ed0db20e.tar.gz inkscape-85ec83bdc0d9b1c11d8789c0edbe6a46ed0db20e.zip | |
fix coding style
Diffstat (limited to 'src')
| -rw-r--r-- | src/display/sp-canvas.cpp | 45 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 4 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.h | 2 | ||||
| -rw-r--r-- | src/ui/interface.cpp | 15 | ||||
| -rw-r--r-- | src/verbs.cpp | 4 |
5 files changed, 30 insertions, 40 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index e9800807c..5c2a6d014 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -361,7 +361,8 @@ void sp_canvas_item_dispose(GObject *object) G_OBJECT_CLASS(sp_canvas_item_parent_class)->dispose(object); } -void sp_reset_spliter(SPCanvas * canvas) { +void sp_reset_spliter(SPCanvas *canvas) +{ canvas->_spliter = Geom::OptIntRect(); canvas->_spliter_area = Geom::OptIntRect(); canvas->_spliter_control = Geom::OptIntRect(); @@ -1836,7 +1837,7 @@ void SPCanvas::paintSingleBuffer(Geom::IntRect const &paint_rect, Geom::IntRect paint_rect.height() * _device_scale, stride); cairo_surface_set_device_scale(imgs, _device_scale, _device_scale); - + buf.ct = cairo_create(imgs); cairo_save(buf.ct); @@ -1896,8 +1897,7 @@ void SPCanvas::paintXRayBuffer(Geom::IntRect const &paint_rect, Geom::IntRect co // initialized. if (_backing_store == nullptr) return; - Geom::IntRect rect_moved = Geom::IntRect::from_xywh(_x0,_y0, _x0 + paint_rect.width(), - _y0 + paint_rect.height()); + Geom::IntRect rect_moved = Geom::IntRect::from_xywh(_x0, _y0, _x0 + paint_rect.width(), _y0 + paint_rect.height()); SPCanvasBuf buf; buf.buf = nullptr; buf.buf_rowstride = 0; @@ -1913,19 +1913,17 @@ void SPCanvas::paintXRayBuffer(Geom::IntRect const &paint_rect, Geom::IntRect co assert(paint_rect.top() - _y0 >= 0); assert(paint_rect.right() - _x0 <= cairo_image_surface_get_width(_backing_store)); assert(paint_rect.bottom() - _y0 <= cairo_image_surface_get_height(_backing_store)); - cairo_surface_t *copy_backing = cairo_surface_create_similar_image (_backing_store, - CAIRO_FORMAT_ARGB32, - paint_rect.width(), - paint_rect.height()); -/* Geom::Point _xray_orig = desktop->doc2dt(desktop->point()); - _xray_orig *= desktop->current_zoom(); */ + cairo_surface_t *copy_backing = cairo_surface_create_similar_image(_backing_store, CAIRO_FORMAT_ARGB32, + paint_rect.width(), paint_rect.height()); + /* Geom::Point _xray_orig = desktop->doc2dt(desktop->point()); + _xray_orig *= desktop->current_zoom(); */ buf.ct = cairo_create(copy_backing); - cairo_t * result = cairo_create(_backing_store); + cairo_t *result = cairo_create(_backing_store); cairo_translate(result, -_x0, -_y0); cairo_save(buf.ct); cairo_set_source_rgba(buf.ct, 1, 1, 1, 0); cairo_fill(buf.ct); - cairo_arc(buf.ct, _xray_radius, _xray_radius, _xray_radius, 0, 2*M_PI); + cairo_arc(buf.ct, _xray_radius, _xray_radius, _xray_radius, 0, 2 * M_PI); cairo_clip(buf.ct); cairo_paint(buf.ct); cairo_set_source(buf.ct, _background); @@ -1940,19 +1938,19 @@ void SPCanvas::paintXRayBuffer(Geom::IntRect const &paint_rect, Geom::IntRect co SP_CANVAS_ITEM_GET_CLASS(_root)->render(_root, &buf); } cairo_restore(buf.ct); - cairo_arc(buf.ct, _xray_radius, _xray_radius, _xray_radius, 0, 2*M_PI); + cairo_arc(buf.ct, _xray_radius, _xray_radius, _xray_radius, 0, 2 * M_PI); cairo_clip(buf.ct); cairo_set_operator(buf.ct, CAIRO_OPERATOR_DEST_IN); cairo_paint(buf.ct); - //cairo_arc(buf.ct, _xray_orig[Geom::X], _xray_orig[Geom::Y], _xray_radius, 0, 2*M_PI); - //cairo_clip(buf.ct); - //cairo_paint(buf.ct); + // cairo_arc(buf.ct, _xray_orig[Geom::X], _xray_orig[Geom::Y], _xray_radius, 0, 2*M_PI); + // cairo_clip(buf.ct); + // cairo_paint(buf.ct); // cairo_surface_write_to_png( copy_backing, "debug2.png" ); // output to X - cairo_arc(buf.ct, _xray_radius, _xray_radius, _xray_radius, 0, 2*M_PI); - - cairo_set_source_surface(result, copy_backing, paint_rect.left(), paint_rect.top()); + cairo_arc(buf.ct, _xray_radius, _xray_radius, _xray_radius, 0, 2 * M_PI); + + cairo_set_source_surface(result, copy_backing, paint_rect.left(), paint_rect.top()); cairo_set_operator(buf.ct, CAIRO_OPERATOR_IN); cairo_paint(result); cairo_destroy(buf.ct); @@ -2476,12 +2474,9 @@ int SPCanvas::paint() arena->drawing.setRenderMode(Inkscape::RENDERMODE_OUTLINE); bool exact = arena->drawing.getExact(); arena->drawing.setExact(false); - Geom::IntRect canvas_rect = Geom::IntRect::from_xywh(_x0, _y0, - allocation.width, allocation.height); - Geom::IntRect _xray_rect = Geom::IntRect::from_xywh(_xray_orig[0]-_xray_radius, - _xray_orig[1]-_xray_radius, - (_xray_radius * 2), - (_xray_radius * 2)); + Geom::IntRect canvas_rect = Geom::IntRect::from_xywh(_x0, _y0, allocation.width, allocation.height); + Geom::IntRect _xray_rect = Geom::IntRect::from_xywh(_xray_orig[0] - _xray_radius, _xray_orig[1] - _xray_radius, + (_xray_radius * 2), (_xray_radius * 2)); paintXRayBuffer(_xray_rect, canvas_rect); arena->drawing.setExact(exact); arena->drawing.setRenderMode(rm); diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 09f3e051a..ec630dcb3 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1727,8 +1727,8 @@ void InkscapePreferences::initPageRendering() // rendering xray radius _rendering_xray_radius.init("/options/rendering/xray-radius", 1.0, 1500.0, 1.0, 100.0, 100.0, true, false); - _page_rendering.add_line( false, _("Rendering XRay radius:"), _rendering_xray_radius, "", - _("XRay mode radius preview"), false); + _page_rendering.add_line(false, _("Rendering XRay radius:"), _rendering_xray_radius, "", + _("XRay mode radius preview"), false); /* blur quality */ _blur_quality_best.init ( _("Best quality (slowest)"), "/options/blurquality/value", diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 8cfaa5a35..ee3d8daa4 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -309,7 +309,7 @@ protected: UI::Widget::PrefCheckButton _rendering_image_outline; UI::Widget::PrefSpinButton _rendering_cache_size; UI::Widget::PrefSpinButton _rendering_tile_multiplier; - UI::Widget::PrefSpinButton _rendering_xray_radius; + UI::Widget::PrefSpinButton _rendering_xray_radius; UI::Widget::PrefSpinButton _filter_multi_threaded; UI::Widget::PrefCheckButton _trans_scale_stroke; diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index aa322250b..0ca0f0ec6 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -614,20 +614,15 @@ static gboolean checkitem_update(GtkWidget *widget, cairo_t * /*cr*/, gpointer u if (!strcmp(action->id, "ToggleGrid")) { ison = dt->gridsEnabled(); - } - else if (!strcmp(action->id, "EditGuidesToggleLock")) { + } else if (!strcmp(action->id, "EditGuidesToggleLock")) { ison = dt->namedview->lockguides; - } - else if (!strcmp(action->id, "ToggleGuides")) { + } else if (!strcmp(action->id, "ToggleGuides")) { ison = dt->namedview->getGuides(); - } - else if (!strcmp(action->id, "ViewCmsToggle")) { + } else if (!strcmp(action->id, "ViewCmsToggle")) { ison = dt->colorProfAdjustEnabled(); - } - else if (!strcmp(action->id, "ViewSplitModeToggle")) { + } else if (!strcmp(action->id, "ViewSplitModeToggle")) { ison = dt->splitMode(); - } - else if (!strcmp(action->id, "ViewXRayToggle")) { + } else if (!strcmp(action->id, "ViewXRayToggle")) { ison = dt->xrayMode(); } else { ison = getViewStateFromPref(view, pref); diff --git a/src/verbs.cpp b/src/verbs.cpp index 8fa8132aa..8ee8d671d 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -3128,8 +3128,8 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_VIEW_TOGGLE_SPLIT, "ViewSplitModeToggle", N_("Toggle _Split View Mode"), N_("Split canvas in 2 to show outline"), nullptr), - new ZoomVerb(SP_VERB_VIEW_TOGGLE_XRAY, "ViewXRayToggle", N_("Toggle _XRay Mode"), - N_("XRay arround cursor"), nullptr), + new ZoomVerb(SP_VERB_VIEW_TOGGLE_XRAY, "ViewXRayToggle", N_("Toggle _XRay Mode"), N_("XRay arround cursor"), + nullptr), new ZoomVerb(SP_VERB_VIEW_CMS_TOGGLE, "ViewCmsToggle", N_("Color-managed view"), N_("Toggle color-managed display for this document window"), INKSCAPE_ICON("color-management")), |
