OSDN Git Service

発言一覧のステータスアイコンをDPI設定に応じてスケールさせる
authorKimura Youichi <kim.upsilon@bucyou.net>
Sat, 16 Nov 2013 06:44:01 +0000 (15:44 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 16 Nov 2013 07:16:40 +0000 (16:16 +0900)
OpenTween/Tween.cs

index 0c891ec..53ef288 100644 (file)
@@ -5561,6 +5561,7 @@ namespace OpenTween
 
             // ディスプレイの DPI 設定を考慮したアイコンサイズ
             var realIconSize = new SizeF(this._iconSz * this.currentScaleFactor.Width, this._iconSz * this.currentScaleFactor.Height);
+            var realStateSize = new SizeF(16 * this.currentScaleFactor.Width, 16 * this.currentScaleFactor.Height);
 
             RectangleF iconRect;
             RectangleF stateRect;
@@ -5568,13 +5569,13 @@ namespace OpenTween
             {
                 iconRect = RectangleF.Intersect(new RectangleF(e.Item.GetBounds(ItemBoundsPortion.Icon).Location, realIconSize), itemRect);
                 iconRect.Offset(0, Math.Max(0, (itemRect.Height - realIconSize.Height) / 2));
-                stateRect = RectangleF.Intersect(new RectangleF(iconRect.X + iconRect.Width + 2, iconRect.Y, 18, 16), itemRect);
+                stateRect = RectangleF.Intersect(new RectangleF(new PointF(iconRect.X + iconRect.Width + 2, iconRect.Y), realStateSize), itemRect);
             }
             else
             {
                 iconRect = RectangleF.Intersect(new RectangleF(e.Item.GetBounds(ItemBoundsPortion.Icon).Location, new Size(1, 1)), itemRect);
                 //iconRect.Offset(0, Math.Max(0, (itemRect.Height - realIconSize.Height) / 2));
-                stateRect = RectangleF.Intersect(new RectangleF(iconRect.X + iconRect.Width + 2, iconRect.Y, 18, 16), itemRect);
+                stateRect = RectangleF.Intersect(new RectangleF(new PointF(iconRect.X + iconRect.Width + 2, iconRect.Y), realStateSize), itemRect);
             }
 
             var img = item.Image;