BasicBot: Fix DPI scaling issues.
This commit is contained in:
parent
1ebdfa149a
commit
d3b62009e6
|
@ -16,6 +16,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public static float AutoScaleFactorY { get; } = AutoScaleCurrentSize.Height / AutoScaleBaseSize.Height;
|
||||
|
||||
public static SizeF AutoScaleFactor { get; } = new SizeF(AutoScaleFactorX, AutoScaleFactorY);
|
||||
|
||||
public static int ScaleX(int size)
|
||||
{
|
||||
return (int)Math.Round(size * AutoScaleFactorX);
|
||||
|
|
|
@ -845,14 +845,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
StartFromSlotBox.SelectedIndex = 0;
|
||||
|
||||
int starty = 0;
|
||||
const int starty = 0;
|
||||
const int lineHeight = 30;
|
||||
const int marginLeft = 15;
|
||||
int accumulatedy = 0;
|
||||
int lineHeight = 30;
|
||||
int marginLeft = 15;
|
||||
int count = 0;
|
||||
|
||||
ControlProbabilityPanel.SuspendLayout();
|
||||
ControlProbabilityPanel.Controls.Clear();
|
||||
|
||||
foreach (var button in Emulator.ControllerDefinition.BoolButtons)
|
||||
{
|
||||
var control = new BotControlsRow
|
||||
|
@ -863,11 +863,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
TabIndex = count + 1,
|
||||
ProbabilityChangedCallback = AssessRunButtonStatus
|
||||
};
|
||||
control.Scale(UIHelper.AutoScaleFactor);
|
||||
|
||||
ControlProbabilityPanel.Controls.Add(control);
|
||||
accumulatedy += lineHeight;
|
||||
count++;
|
||||
}
|
||||
ControlProbabilityPanel.ResumeLayout();
|
||||
|
||||
if (Settings.RecentBotFiles.AutoLoad)
|
||||
{
|
||||
|
|
|
@ -72,8 +72,7 @@
|
|||
//
|
||||
// BotControlsRow
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
|
||||
this.Controls.Add(this.ProbabilitySlider);
|
||||
this.Controls.Add(this.ProbabilityUpDown);
|
||||
this.Controls.Add(this.ButtonNameLabel);
|
||||
|
|
Loading…
Reference in New Issue