summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-03-11 08:28:13 +0000
committerNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-03-11 11:02:11 +0000
commit7934424ce7b4ff5b0929a4a33caf89ea567400e7 (patch)
tree2bb3b8acb8d82ef67f48f14044aa23da834088f6 /src
parentRemove INKSCAPE_PORTABLE_PROFILE_DIR (diff)
downloadinkscape-7934424ce7b4ff5b0929a4a33caf89ea567400e7.tar.gz
inkscape-7934424ce7b4ff5b0929a4a33caf89ea567400e7.zip
Update translation dialog for flipped axis
Flipping icon no longer works, now that we use icon themes. Fixes https://gitlab.com/inkscape/inkscape/issues/127
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/transformation.cpp18
-rw-r--r--src/ui/widget/labelled.cpp5
-rw-r--r--src/ui/widget/labelled.h5
3 files changed, 10 insertions, 18 deletions
diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp
index 50631a16b..c9daba2b2 100644
--- a/src/ui/dialog/transformation.cpp
+++ b/src/ui/dialog/transformation.cpp
@@ -73,7 +73,7 @@ Transformation::Transformation()
"", "transform-rotate", &_units_rotate),
_scalar_skew_horizontal (_("_Horizontal:"), _("Horizontal skew angle (positive = counterclockwise), or absolute displacement, or percentage displacement"), UNIT_TYPE_LINEAR,
"", "transform-skew-horizontal", &_units_skew),
- _scalar_skew_vertical (_("_Vertical:"), _("Vertical skew angle (positive = counterclockwise), or absolute displacement, or percentage displacement"), UNIT_TYPE_LINEAR,
+ _scalar_skew_vertical (_("_Vertical:"), _("Vertical skew angle (positive = clockwise), or absolute displacement, or percentage displacement"), UNIT_TYPE_LINEAR,
"", "transform-skew-vertical", &_units_skew),
_scalar_transform_a ("_A:", _("Transformation matrix element A")),
@@ -130,13 +130,6 @@ Transformation::Transformation()
_check_apply_separately.set_active(prefs->getBool("/dialogs/transformation/applyseparately"));
_check_apply_separately.signal_toggled().connect(sigc::mem_fun(*this, &Transformation::onApplySeparatelyToggled));
- // make icons match desktop rotation direction
- if (!getDesktop()->is_yaxisdown()) {
- _scalar_move_vertical.flipIconVertically();
- _scalar_rotate.flipIconVertically();
- _scalar_skew_vertical.flipIconVertically();
- }
-
// make sure all spinbuttons activate Apply on pressing Enter
((Gtk::Entry *) (_scalar_move_horizontal.getWidget()))->set_activates_default(true);
((Gtk::Entry *) (_scalar_move_vertical.getWidget()))->set_activates_default(true);
@@ -634,6 +627,9 @@ void Transformation::applyPageMove(Inkscape::Selection *selection)
{
double x = _scalar_move_horizontal.getValue("px");
double y = _scalar_move_vertical.getValue("px");
+ if (_check_move_relative.get_active()) {
+ y *= getDesktop()->yaxisdir();
+ }
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
if (!prefs->getBool("/dialogs/transformation/applyseparately")) {
@@ -809,6 +805,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
if (!_units_skew.isAbsolute()) { // percentage
double skewX = _scalar_skew_horizontal.getValue("%");
double skewY = _scalar_skew_vertical.getValue("%");
+ skewY *= getDesktop()->yaxisdir();
if (fabs(0.01*skewX*0.01*skewY - 1.0) < Geom::EPSILON) {
getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
return;
@@ -826,10 +823,12 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
}
double skewX = tan(-angleX);
double skewY = tan(angleY);
+ skewY *= getDesktop()->yaxisdir();
sp_item_skew_rel (item, skewX, skewY);
} else { // absolute displacement
double skewX = _scalar_skew_horizontal.getValue("px");
double skewY = _scalar_skew_vertical.getValue("px");
+ skewY *= getDesktop()->yaxisdir();
Geom::OptRect bbox = item->desktopPreferredBounds();
if (bbox) {
double width = bbox->dimensions()[Geom::X];
@@ -853,6 +852,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
if (!_units_skew.isAbsolute()) { // percentage
double skewX = _scalar_skew_horizontal.getValue("%");
double skewY = _scalar_skew_vertical.getValue("%");
+ skewY *= getDesktop()->yaxisdir();
if (fabs(0.01*skewX*0.01*skewY - 1.0) < Geom::EPSILON) {
getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
return;
@@ -870,10 +870,12 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
}
double skewX = tan(-angleX);
double skewY = tan(angleY);
+ skewY *= getDesktop()->yaxisdir();
selection->skewRelative(*center, skewX, skewY);
} else { // absolute displacement
double skewX = _scalar_skew_horizontal.getValue("px");
double skewY = _scalar_skew_vertical.getValue("px");
+ skewY *= getDesktop()->yaxisdir();
if (fabs(skewX*skewY - width*height) < Geom::EPSILON) {
getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
return;
diff --git a/src/ui/widget/labelled.cpp b/src/ui/widget/labelled.cpp
index a44e69fcb..dfbc01ddd 100644
--- a/src/ui/widget/labelled.cpp
+++ b/src/ui/widget/labelled.cpp
@@ -74,11 +74,6 @@ Labelled::setTooltipText(const Glib::ustring &tooltip)
_widget->set_tooltip_text(tooltip);
}
-void Labelled::flipIconVertically()
-{
- _icon->set(_icon->get_pixbuf()->flip(false));
-}
-
bool Labelled::on_mnemonic_activate ( bool group_cycling )
{
return _widget->mnemonic_activate ( group_cycling );
diff --git a/src/ui/widget/labelled.h b/src/ui/widget/labelled.h
index e0ffa20c4..01fe86072 100644
--- a/src/ui/widget/labelled.h
+++ b/src/ui/widget/labelled.h
@@ -58,11 +58,6 @@ public:
void setLabelText(const Glib::ustring &str);
void setTooltipText(const Glib::ustring &tooltip);
- /**
- * For matching flipped desktop y-direction
- */
- void flipIconVertically();
-
private:
bool on_mnemonic_activate( bool group_cycling ) override;