/*
5 * Authors: see git history
7 * Copyright (C) 2018 Authors
8 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
10#include <glibmm/i18n.h>
48 _(
"<b>Current layer is hidden</b>. Unhide it to be able to draw on it."));
52 if ( layer->isLocked() ) {
54 _(
"<b>Current layer is locked</b>. Unlock it to be able to draw on it."));
77 _(
"<b>Current layer is hidden</b>. Unhide it to be able to draw on it."));
81 if ( layer->isLocked() ) {
83 _(
"<b>Current layer is locked</b>. Unlock it to be able to draw on it."));
97 auto confine = Modifiers::Modifier::get(Modifiers::Type::TRANS_CONFINE)->active(state);
98 auto off_center = Modifiers::Modifier::get(Modifiers::Type::TRANS_OFF_CENTER)->active(state);
100 auto rect_edge = Modifiers::Modifier::get(Modifiers::Type::TRANS_INCREMENT)->active(state);
116 double ratioabs = fabs (ratio);
117 double sign = (ratio < 0 ? -1 : 1);
125 double ratioabs = fabs(ratio);
126 double sign = (ratio < 0 ? -1 : 1);
136 double sign = (ratio < 0 ? -1 : 1);
145 p[1] = center +
delta;
153 p[0] = center -
delta;
167 if (s[0].getSnapped()) {
169 p[1] = 2 * center - s[0].
getPoint();
173 if (s[1].getSnapped()) {
174 p[0] = 2 * center - s[1].
getPoint();
190 }
else if (off_center) {
195 p[0] = 2 * center - p[1];
203 if (s[0].getSnapped()) {
205 p[1] = 2 * center - s[0].
getPoint();
209 if (s[1].getSnapped()) {
210 p[0] = 2 * center - s[1].
getPoint();
Two-dimensional point that doubles as a vector.
Axis aligned, non-empty rectangle.
void remove_snaptarget(bool only_if_presnap=false)
void set_new_snaptarget(Inkscape::SnappedPoint const &p, bool pre_snap=false)
SPGroup * currentLayer() const
Returns current top layer.
A convenience class for working with MessageStacks.
void flash(MessageType type, char const *message)
pushes a message onto the stack for a brief period of time without disturbing our "current" message
A class which holds a stack of displayed messages.
MessageId flash(MessageType type, char const *message)
Temporarily pushes a message onto the stack.
Class to store data for points which are snap candidates, either as a source or as a target.
Class describing the result of an attempt to snap.
Geom::Point getPoint() const
Geom::Coord getSnapDistance() const
To do: update description of desktop.
bool itemIsHidden(SPItem const *item) const
Geom::Affine const & dt2doc() const
Inkscape::Display::SnapIndicator * getSnapIndicator() const
SPNamedView * getNamedView() const
Inkscape::LayerManager & layerManager()
Base class for visual SVG elements.
void setup(SPDesktop const *desktop, bool snapindicator=true, SPObject const *item_to_ignore=nullptr, std::vector< Inkscape::SnapCandidatePoint > *unselected_nodes=nullptr)
Convenience shortcut when there is only one item to ignore.
static const double midpt_1_goldenratio
static const double midpt_goldenratio_2
constexpr double goldenratio
Editable view implementation.
auto floor(Geom::Rect const &rect)
Interface for locally managing a current status message.
Raw stack of active status messages.
Geom::Rect snap_rectangular_box(SPDesktop const *desktop, SPItem *item, Geom::Point const &pt, Geom::Point const ¢er, int state)
bool have_viable_layer(SPDesktop *desktop, MessageContext *message)
Check to see if the current layer is both unhidden and unlocked.
static double sign(double const x)
Returns -1 or 1 according to the sign of x.
Provides a class that shows a temporary indicator on the canvas of where the snap was,...