mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
New rotation system (see forum thread).
Major changes: - when rotating, the top left corner of the rectangle stays in place. - ValueViewers get a dc that is pre-rotated/translated for them, i.e. (0,0) is the top-left of the viewer (with ValueViewer::getRotation). - moved 'angle' from individual Styles to the Style base class. - any rotation angle is now possible. angle is still an int for now. This warrants a version bump git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@782 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -84,10 +84,13 @@ struct Rotate270 {
|
||||
|
||||
Image rotate_image(const Image& image, int angle) {
|
||||
switch (angle % 360) {
|
||||
case 0: return image;
|
||||
case 90: return rotate_image_impl<Rotate90> (image);
|
||||
case 180: return rotate_image_impl<Rotate180>(image);
|
||||
case 270: return rotate_image_impl<Rotate270>(image);
|
||||
default: return image;
|
||||
default:
|
||||
if (!image.HasAlpha()) const_cast<Image&>(image).InitAlpha();
|
||||
return image.Rotate(angle * M_PI / 180, wxPoint(0,0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user