Skip to content

Commit

Permalink
Update CairoHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Jun 11, 2024
1 parent 84ea912 commit 40fc063
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Helpers/CairoHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void
CairoHelper::applyScale(cairo_t *cr,
const _XY &scale)
{
if (!cr || (scale.x == 0. && scale.y == 0.)) { return; }
if (!cr || (scale.x == 1. && scale.y == 1.)) { return; }
cairo_scale(cr, scale.x, scale.y);
}

Expand All @@ -50,7 +50,7 @@ CairoHelper::applyScale(cairo_t *cr,
const _XY &scale,
const _XY &origin)
{
if (!cr || (scale.x == 0. && scale.y == 0.)) { return; }
if (!cr || (scale.x == 1. && scale.y == 1.)) { return; }
cairo_translate(cr, origin.x, origin.y);
cairo_scale(cr, scale.x, scale.y);
cairo_translate(cr, -origin.x, -origin.y);
Expand Down Expand Up @@ -92,7 +92,6 @@ CairoHelper::applyTransform(cairo_t *cr,
const _Transform &transform)
{
if (!cr) { return; }
if (transform.flip) { applyFlip(cr, transform.height); }
if (transform.position) { applyPosition(cr, transform.origin); }
applyScale(cr, transform.scale, transform.origin);
applySkew(cr, transform.skew, transform.origin);
Expand Down
3 changes: 0 additions & 3 deletions Helpers/CairoHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ class CairoHelper
_XY origin;
_XY scale;
_XY skew;
int width;
int height;
double rotate;
bool position;
bool flip;
};
/** @brief apply flip */
static void applyFlip(cairo_t *cr,
Expand Down

0 comments on commit 40fc063

Please sign in to comment.