diff --git a/CnCTDRAMapEditor/App.config b/CnCTDRAMapEditor/App.config
index 4d80115..627118a 100644
--- a/CnCTDRAMapEditor/App.config
+++ b/CnCTDRAMapEditor/App.config
@@ -35,6 +35,9 @@
0.5
+
+ 0.3
+
diff --git a/CnCTDRAMapEditor/Controls/TypeComboBox.cs b/CnCTDRAMapEditor/Controls/TypeComboBox.cs
index c5e717a..d1951d0 100644
--- a/CnCTDRAMapEditor/Controls/TypeComboBox.cs
+++ b/CnCTDRAMapEditor/Controls/TypeComboBox.cs
@@ -57,7 +57,8 @@ namespace MobiusEditor.Controls
var typeItem = Items[e.Index] as TypeItem;
if (typeItem?.Type != null)
{
- e.ItemHeight = typeItem.Type.Thumbnail?.Height ?? MissingThumbnail.Height;
+ e.ItemHeight = (int)((typeItem.Type.Thumbnail?.Height ?? MissingThumbnail.Height) *
+ Properties.Settings.Default.ObjectToolItemSizeMultiplier);
}
}
@@ -66,6 +67,7 @@ namespace MobiusEditor.Controls
base.OnDrawItem(e);
e.DrawBackground();
+ e.DrawFocusRectangle();
if ((e.Index >= 0) && (e.Index < Items.Count))
{
@@ -84,15 +86,27 @@ namespace MobiusEditor.Controls
if ((e.State & DrawItemState.ComboBoxEdit) == DrawItemState.None)
{
var thumbnail = typeItem.Type.Thumbnail ?? MissingThumbnail;
- var thumbnailWidth = (int)Math.Min(e.Bounds.Width - textSize.Width, thumbnail.Width);
- var thumbnailSize = new Size(thumbnailWidth, thumbnailWidth * thumbnail.Height / thumbnail.Width);
+ var thumbnailWidth = (int)Math.Min((e.Bounds.Width - textSize.Width),
+ thumbnail.Width);
+ int thumbnailHeight = (int)Math.Min(e.Bounds.Height, thumbnail.Height);
+
+ double widthRatio = (e.Bounds.Width - textSize.Width) / (double)thumbnail.Width;
+ double heightRatio = e.Bounds.Height / (double)thumbnail.Height;
+ if (heightRatio < widthRatio)
+ {
+ thumbnailWidth = (int)(thumbnail.Width * heightRatio);
+ }
+ else
+ {
+ thumbnailHeight = (int)(thumbnail.Height * widthRatio);
+ }
+
+ var thumbnailSize = new Size(thumbnailWidth, thumbnailHeight);
var thumbnailBounds = new Rectangle(new Point(e.Bounds.Right - thumbnailSize.Width, e.Bounds.Top), thumbnailSize);
e.Graphics.DrawImage(thumbnail, thumbnailBounds);
}
}
}
-
- e.DrawFocusRectangle();
}
}
}
diff --git a/CnCTDRAMapEditor/Properties/Settings.Designer.cs b/CnCTDRAMapEditor/Properties/Settings.Designer.cs
index 32f8069..7bce06f 100644
--- a/CnCTDRAMapEditor/Properties/Settings.Designer.cs
+++ b/CnCTDRAMapEditor/Properties/Settings.Designer.cs
@@ -91,5 +91,17 @@ namespace MobiusEditor.Properties {
this["TemplateToolTextureSizeMultiplier"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("0.3")]
+ public double ObjectToolItemSizeMultiplier {
+ get {
+ return ((double)(this["ObjectToolItemSizeMultiplier"]));
+ }
+ set {
+ this["ObjectToolItemSizeMultiplier"] = value;
+ }
+ }
}
}
diff --git a/CnCTDRAMapEditor/Properties/Settings.settings b/CnCTDRAMapEditor/Properties/Settings.settings
index 84e785a..2c7d143 100644
--- a/CnCTDRAMapEditor/Properties/Settings.settings
+++ b/CnCTDRAMapEditor/Properties/Settings.settings
@@ -20,5 +20,8 @@
0.5
+
+ 0.3
+
\ No newline at end of file