mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
(minor) use getAngle() instead of trAngle(0)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1470 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -72,6 +72,7 @@ RealSize Rotation::trSize(const RealSize& size) const {
|
||||
return RealSize(c * x + s * y, s * x + c * y);
|
||||
}
|
||||
*/
|
||||
|
||||
RealSize Rotation::trSizeToBB(const RealSize& size) const {
|
||||
if (straight()) {
|
||||
if (sideways()) {
|
||||
@@ -85,6 +86,7 @@ RealSize Rotation::trSizeToBB(const RealSize& size) const {
|
||||
return RealSize(fabs(c * x) + fabs(s * y), fabs(s * x) + fabs(c * y));
|
||||
}
|
||||
}
|
||||
|
||||
RealRect Rotation::trRectToBB(const RealRect& r) const {
|
||||
if (straight()) {
|
||||
RealSize s = trSizeToBB(r.size());
|
||||
@@ -117,6 +119,8 @@ RealRect Rotation::trRectToBB(const RealRect& r) const {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RealRect Rotation::trRectStraight(const RealRect& r) const {
|
||||
assert(angle == 0);
|
||||
return RealRect(r.position() + origin, r.size());
|
||||
@@ -139,6 +143,11 @@ RealPoint Rotation::trInv(const RealPoint& p) const {
|
||||
return RealPoint((c * x - s * y) / zoomX,
|
||||
(s * x + c * y) / zoomY);
|
||||
}
|
||||
RealSize Rotation::trInv(const RealSize& x) const {
|
||||
double a = deg_to_rad(angle), s = sin(a), c = cos(a);
|
||||
return RealSize((c * x.width - s * x.height) / zoomX,
|
||||
(s * x.width + c * x.height) / zoomY);
|
||||
}
|
||||
|
||||
RealPoint Rotation::boundingBoxCorner(const RealSize& size) const {
|
||||
// This function is a bit tricky,
|
||||
|
||||
Reference in New Issue
Block a user