mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
rotation and style changing works
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@144 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -17,12 +17,15 @@ int constrain_angle(int angle) {
|
||||
return (a / 90) * 90; // multiple of 90
|
||||
}
|
||||
|
||||
Rotation::Rotation(int angle, const RealRect& rect, double zoom)
|
||||
Rotation::Rotation(int angle, const RealRect& rect, double zoom, bool is_internal)
|
||||
: angle(constrain_angle(angle))
|
||||
, size(rect.size())
|
||||
, origin(rect.position())
|
||||
, zoom(zoom)
|
||||
{
|
||||
if (is_internal) {
|
||||
size = trNoNeg(size);
|
||||
}
|
||||
// set origin
|
||||
if (revX()) origin.x += size.width;
|
||||
if (revY()) origin.y += size.height;
|
||||
@@ -108,12 +111,12 @@ Rotater::~Rotater() {
|
||||
|
||||
// ----------------------------------------------------------------------------- : RotatedDC
|
||||
|
||||
RotatedDC::RotatedDC(DC& dc, int angle, const RealRect& rect, double zoom, bool high_quality)
|
||||
: Rotation(angle, rect, zoom)
|
||||
RotatedDC::RotatedDC(DC& dc, int angle, const RealRect& rect, double zoom, bool high_quality, bool is_internal)
|
||||
: Rotation(angle, rect, zoom, is_internal)
|
||||
, dc(dc), high_quality(high_quality)
|
||||
{}
|
||||
|
||||
RotatedDC::RotatedDC(DC& dc, const Rotation& rotation, bool high_quality = false)
|
||||
RotatedDC::RotatedDC(DC& dc, const Rotation& rotation, bool high_quality)
|
||||
: Rotation(rotation)
|
||||
, dc(dc), high_quality(high_quality&&false)
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user