mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 14:07:01 -04:00
Simpler implementation of stretch-overflow with rotation and alignment.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@734 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -82,12 +82,7 @@ class TextStyle : public Style {
|
|||||||
|
|
||||||
/// The rotation to use when drawing
|
/// The rotation to use when drawing
|
||||||
inline Rotation getRotation() const {
|
inline Rotation getRotation() const {
|
||||||
double stretch = getStretch();
|
return Rotation(angle, getRect(), 1.0, getStretch());
|
||||||
if (sideways(angle)) {
|
|
||||||
return Rotation(angle, getRect(), stretch, 1/stretch);
|
|
||||||
} else {
|
|
||||||
return Rotation(angle, getRect(), 1.0, stretch);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/// The rotation to use when determining content layout, does not include the stretch factor
|
/// The rotation to use when determining content layout, does not include the stretch factor
|
||||||
inline Rotation getRotationNoStretch() const {
|
inline Rotation getRotationNoStretch() const {
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ Rotation::Rotation(int angle, const RealRect& rect, double zoom, double strectch
|
|||||||
: angle(constrain_angle(angle))
|
: angle(constrain_angle(angle))
|
||||||
, size(rect.size())
|
, size(rect.size())
|
||||||
, origin(rect.position())
|
, origin(rect.position())
|
||||||
, zoomX(zoom * strectch)
|
, zoomX(::sideways(angle) ? zoom : zoom * strectch)
|
||||||
, zoomY(zoom)
|
, zoomY(!::sideways(angle) ? zoom : zoom * strectch)
|
||||||
{
|
{
|
||||||
if (is_internal) {
|
if (is_internal) {
|
||||||
size = trNoNeg(size);
|
size = trNoNeg(size);
|
||||||
|
|||||||
Reference in New Issue
Block a user