aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/Label.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-04-14 09:36:03 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-04-14 12:47:15 +0200
commit7ff5f14fe6b875dff57b335c4eeeb42397a07c91 (patch)
tree23f80be40c98b4d142894a607c8dd2f43112b523 /src/GraphicObjects/Label.cs
parent0b005fefe69b67bf335c3c00944bbac73e8b4831 (diff)
proportional ui
Diffstat (limited to 'src/GraphicObjects/Label.cs')
-rw-r--r--src/GraphicObjects/Label.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs
index c28f090c..0a909b73 100644
--- a/src/GraphicObjects/Label.cs
+++ b/src/GraphicObjects/Label.cs
@@ -397,7 +397,8 @@ namespace Crow
Rectangle cb = ClientRectangle;
//ignore text alignment if size to content = true
- if (Width < 0 || Height < 0)
+ //TODO: split horizontal and vertical logic
+ if (Width == Measure.Fit || Height == Measure.Fit)
{
rText.X = cb.X;
rText.Y = cb.Y;
@@ -406,7 +407,9 @@ namespace Crow
widthRatio = (float)cb.Width / rText.Width;
if (!verticalStretch)
heightRatio = widthRatio;
- }if (verticalStretch) {
+ }
+
+ if (verticalStretch) {
heightRatio = (float)cb.Height / rText.Height;
if (!horizontalStretch)
widthRatio = heightRatio;