32 : Observer(
"/tools/bounding_box")
38 _sel_cue._boundingBoxPrefsChanged(
static_cast<int>(val.
getBool()));
80 int prefs_bbox = prefs->
getBool(
"/tools/bounding_box");
101 if (
auto ctrl =
dynamic_cast<CanvasItemCtrl *
>(canvas_item)) {
102 ctrl->set_position(
Geom::Point(b->min().x(), b->max().y()));
103 }
else if (
auto rect =
dynamic_cast<CanvasItemRect *
>(canvas_item)) {
106 canvas_item->set_visible(
true);
108 canvas_item->set_visible(
false);
129 int prefs_bbox = prefs->
getBool(
"/tools/bounding_box");
141 canvas_item = std::move(ctrl);
144 rect->set_stroke(0xffffffa0);
145 rect->set_shadow(0x0000c0a0, 1);
146 rect->set_dashed(
true);
147 rect->set_inverted(
false);
148 canvas_item = std::move(rect);
152 canvas_item->set_pickable(
false);
153 canvas_item->lower_to_bottom();
154 canvas_item->set_visible(
true);
176 auto point = bbox->min() + (bbox->dimensions() * anchor);
177 for (
bool horz : {
false,
true}) {
179 line->lower_to_bottom();
180 line->set_visible(
true);
181 line->set_stroke(0xddddaa11);
182 line->set_inverted(
true);
194 std::optional<Geom::Point> pt;
195 if (
auto text = cast<SPText>(
item)) {
196 pt = text->getBaselinePoint();
197 }
else if (
auto flow = cast<SPFlowtext>(
item)) {
198 pt = flow->getBaselinePoint();
203 canvas_item->lower_to_bottom();
204 canvas_item->set_visible(
true);
std::unique_ptr< T, CanvasItemUnlinkDeleter > CanvasItemPtr
Smart pointer used to hold CanvasItems, like std::unique_ptr.
Axis-aligned rectangle that can be empty.
Two-dimensional point that doubles as a vector.
SPItemRange items()
Returns a range of selected SPItems.
Geom::OptRect preferredBounds() const
Returns either the visual or geometric bounding rectangle of the selection, based on the preferences ...
Data type representing a typeless value of a preference.
bool getBool(bool def=false) const
Interpret the preference as a Boolean value.
Preference storage class.
bool getBool(Glib::ustring const &pref_path, bool def=false)
Retrieve a Boolean value.
static Preferences * get()
Access the singleton Preferences object.
int getInt(Glib::ustring const &pref_path, int def=0)
Retrieve an integer.
void addObserver(Observer &)
Register a preference observer.
BoundingBoxPrefsObserver(SelCue &sel_cue)
void notify(Preferences::Entry const &val) override
Notification about a preference change.
sigc::connection _sel_modified_connection
std::vector< CanvasItemPtr< CanvasItem > > _item_bboxes
SelCue(SPDesktop *desktop)
BoundingBoxPrefsObserver _bounding_box_prefs_observer
std::vector< CanvasItemPtr< CanvasItem > > _text_baselines
std::vector< CanvasItemPtr< CanvasItem > > _item_lines
sigc::connection _sel_changed_connection
void _newItemLines()
Create any required visual-only guide lines related to the selection.
void _boundingBoxPrefsChanged(int prefs_bbox)
sigc::connection connectChanged(sigc::slot< void(Selection *)> slot)
Connects a slot to be notified of selection changes.
sigc::connection connectModified(sigc::slot< void(Selection *, unsigned)> slot)
Connects a slot to be notified of selected object modifications.
To do: update description of desktop.
Inkscape::CanvasItemGroup * getCanvasGuides() const
Inkscape::CanvasItemGroup * getCanvasControls() const
Inkscape::Selection * getSelection() const
Geom::Affine i2dt_affine() const
Returns the transformation from item to desktop coords.
Geom::OptRect desktopVisualBounds() const
Get item's visual bbox in desktop coordinate system.
Geom::OptRect desktopGeometricBounds() const
Get item's geometric bbox in desktop coordinate system.
Editable view implementation.
Helper class to stream background task notifications as a series of messages.
@ CANVAS_ITEM_CTRL_TYPE_SIZER
@ CANVAS_ITEM_CTRL_TYPE_SHAPER
TODO: insert short description here.