Commit fc6b0136 authored by twanvl's avatar twanvl

Fixed shrink(-overflow) for rotated fields

parent 2272ab26
...@@ -58,7 +58,7 @@ TextStyle::TextStyle(const TextFieldP& field) ...@@ -58,7 +58,7 @@ TextStyle::TextStyle(const TextFieldP& field)
double TextStyle::getStretch() const { double TextStyle::getStretch() const {
if (content_width > 0 && ((alignment() & ALIGN_STRETCH) || (alignment() & ALIGN_STRETCH_OVERFLOW))) { if (content_width > 0 && ((alignment() & ALIGN_STRETCH) || (alignment() & ALIGN_STRETCH_OVERFLOW))) {
double factor = (sideways(angle) ? double(height) : width - padding_left - padding_right) / content_width; double factor = (width - padding_left - padding_right) / content_width;
if (alignment() == ALIGN_STRETCH || factor < 1.0) { if (alignment() == ALIGN_STRETCH || factor < 1.0) {
return factor; return factor;
} }
......
...@@ -135,9 +135,9 @@ wxRegion Rotation::trRectToRegion(const RealRect& r) const { ...@@ -135,9 +135,9 @@ wxRegion Rotation::trRectToRegion(const RealRect& r) const {
RealPoint Rotation::trInv(const RealPoint& p) const { RealPoint Rotation::trInv(const RealPoint& p) const {
double a = deg_to_rad(angle), s = sin(a), c = cos(a); double a = deg_to_rad(angle), s = sin(a), c = cos(a);
double x = (p.x - origin.x) / zoomX, y = (p.y - origin.y) / zoomY; double x = p.x - origin.x, y = p.y - origin.y;
return RealPoint(c * x - s * y, return RealPoint((c * x - s * y) / zoomX,
s * x + c * y); (s * x + c * y) / zoomY);
} }
RealPoint Rotation::boundingBoxCorner(const RealSize& size) const { RealPoint Rotation::boundingBoxCorner(const RealSize& size) const {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment