mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
stretch-overflow biw works with rotation and alignment.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@733 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -61,7 +61,7 @@ TextStyle::TextStyle(const TextFieldP& field)
|
||||
|
||||
double TextStyle::getStretch() const {
|
||||
if (content_width > 0 && ((alignment() & ALIGN_STRETCH) || (alignment() & ALIGN_STRETCH_OVERFLOW))) {
|
||||
double factor = (width - padding_left - padding_right) / content_width;
|
||||
double factor = (sideways(angle) ? height : width - padding_left - padding_right) / content_width;
|
||||
if (alignment() == ALIGN_STRETCH || factor < 1.0) {
|
||||
return factor;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,12 @@ class TextStyle : public Style {
|
||||
|
||||
/// The rotation to use when drawing
|
||||
inline Rotation getRotation() const {
|
||||
return Rotation(angle, getRect(), 1.0, getStretch());
|
||||
double stretch = 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
|
||||
inline Rotation getRotationNoStretch() const {
|
||||
|
||||
Reference in New Issue
Block a user