summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-11-18 00:38:08 +0000
committerThomas Holder <thomas@thomas-holder.de>2019-11-18 21:54:22 +0000
commit45e39264e590abc05b78d18d373ac83c47b3cfab (patch)
treef4cbf3c1951c1f7e09b0a5c91eb380beb2a33e69
parentMake canvas rotation unchanged by y-axis direction (diff)
downloadinkscape-45e39264e590abc05b78d18d373ac83c47b3cfab.tar.gz
inkscape-45e39264e590abc05b78d18d373ac83c47b3cfab.zip
Update code documentation (minor)
-rw-r--r--src/desktop.cpp68
-rw-r--r--src/desktop.h2
2 files changed, 53 insertions, 17 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 521e7cb03..b055dcf7b 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -1173,7 +1173,10 @@ SPDesktop::zoom_grab_focus()
/**
- * Rotate keeping the point 'c' fixed in the desktop window.
+ * Set new rotation, keeping the point 'c' fixed in the desktop window.
+ *
+ * @param c Point in desktop coordinates
+ * @param rotate Angle in clockwise direction
*/
void
SPDesktop::rotate_absolute_keep_point (Geom::Point const &c, double rotate)
@@ -1184,6 +1187,12 @@ SPDesktop::rotate_absolute_keep_point (Geom::Point const &c, double rotate)
}
+/**
+ * Rotate keeping the point 'c' fixed in the desktop window.
+ *
+ * @param c Point in desktop coordinates
+ * @param rotate Angle in clockwise direction
+ */
void
SPDesktop::rotate_relative_keep_point (Geom::Point const &c, double rotate)
{
@@ -1194,65 +1203,92 @@ SPDesktop::rotate_relative_keep_point (Geom::Point const &c, double rotate)
/**
- * Rotate aligning the point 'c' to the center of desktop window.
+ * Set new rotation, aligning the point 'c' to the center of desktop window.
+ *
+ * @param c Point in desktop coordinates
+ * @param rotate Angle in clockwise direction
*/
void
SPDesktop::rotate_absolute_center_point (Geom::Point const &c, double rotate)
{
_current_affine.setRotate( rotate );
Geom::Rect viewbox = canvas->getViewbox();
- set_display_area( c, viewbox.midpoint() );
+ set_display_area(c, viewbox.midpoint());
}
+/**
+ * Rotate aligning the point 'c' to the center of desktop window.
+ *
+ * @param c Point in desktop coordinates
+ * @param rotate Angle in clockwise direction
+ */
void
SPDesktop::rotate_relative_center_point (Geom::Point const &c, double rotate)
{
_current_affine.addRotate( rotate );
Geom::Rect viewbox = canvas->getViewbox();
- set_display_area( c, viewbox.midpoint() );
+ set_display_area(c, viewbox.midpoint());
}
/**
- * Flip keeping the point 'c' fixed in the desktop window.
+ * Set new flip direction, keeping the point 'c' fixed in the desktop window.
+ *
+ * @param c Point in desktop coordinates
+ * @param flip Direction the canvas will be set as.
*/
void
SPDesktop::flip_absolute_keep_point (Geom::Point const &c, CanvasFlip flip)
{
- Geom::Point w = d2w( c ); // Must be before flip.
- _current_affine.setFlip( flip );
- set_display_area( c, w );
+ Geom::Point w = d2w(c); // Must be before flip.
+ _current_affine.setFlip(flip);
+ set_display_area(c, w);
}
+/**
+ * Flip direction, keeping the point 'c' fixed in the desktop window.
+ *
+ * @param c Point in desktop coordinates
+ * @param flip Direction to flip canvas
+ */
void
SPDesktop::flip_relative_keep_point (Geom::Point const &c, CanvasFlip flip)
{
- Geom::Point w = d2w( c ); // Must be before flip.
- _current_affine.addFlip( flip );
- set_display_area( c, w );
+ Geom::Point w = d2w(c); // Must be before flip.
+ _current_affine.addFlip(flip);
+ set_display_area(c, w);
}
/**
- * Flip aligning the point 'c' to the center of desktop window.
+ * Set new flip direction, aligning the point 'c' to the center of desktop window.
+ *
+ * @param c Point in desktop coordinates
+ * @param flip Direction the canvas will be set as.
*/
void
SPDesktop::flip_absolute_center_point (Geom::Point const &c, CanvasFlip flip)
{
- _current_affine.setFlip( flip );
+ _current_affine.setFlip(flip);
Geom::Rect viewbox = canvas->getViewbox();
- set_display_area( c, viewbox.midpoint() );
+ set_display_area(c, viewbox.midpoint());
}
+/**
+ * Flip direction, aligning the point 'c' to the center of desktop window.
+ *
+ * @param c Point in desktop coordinates
+ * @param flip Direction to flip canvas
+ */
void
SPDesktop::flip_relative_center_point (Geom::Point const &c, CanvasFlip flip)
{
- _current_affine.addFlip( flip );
+ _current_affine.addFlip(flip);
Geom::Rect viewbox = canvas->getViewbox();
- set_display_area( c, viewbox.midpoint() );
+ set_display_area(c, viewbox.midpoint());
}
bool
diff --git a/src/desktop.h b/src/desktop.h
index a8d93278b..69726ce26 100644
--- a/src/desktop.h
+++ b/src/desktop.h
@@ -559,7 +559,7 @@ private:
Geom::Affine _w2d; // Window to desktop
Geom::Affine _d2w; // Desktop to window
Geom::Rotate _rotate; // Rotate part of _w2d
- Geom::Scale _scale; // Scale part of _w2d
+ Geom::Scale _scale; // Scale part of _w2d, holds y-axis direction
Geom::Scale _flip; // Flip part of _w2d
Geom::Point _offset; // Point on canvas to align to (0,0) of window
};