Shuffle logic between `ScreenshotForm.UpdateValues` and call-site
This commit is contained in:
parent
3cb7847b35
commit
73c3056bd6
|
@ -657,20 +657,22 @@ namespace BizHawk.Client.EmuHawk
|
||||||
&& targetRow < Branches.Count)
|
&& targetRow < Branches.Count)
|
||||||
{
|
{
|
||||||
var branch = Branches[targetRow];
|
var branch = Branches[targetRow];
|
||||||
|
var bb = branch.OSDFrameBuffer;
|
||||||
|
var width = bb.Width;
|
||||||
Point location = PointToScreen(Location);
|
Point location = PointToScreen(Location);
|
||||||
int width = branch.OSDFrameBuffer.Width;
|
|
||||||
int height = branch.OSDFrameBuffer.Height;
|
|
||||||
location.Offset(-width, 0);
|
location.Offset(-width, 0);
|
||||||
|
|
||||||
if (location.X < 0)
|
if (location.X < 0)
|
||||||
{
|
{
|
||||||
location.Offset(width + Width, 0);
|
location.Offset(width + Width, 0);
|
||||||
}
|
}
|
||||||
|
_screenshot.UpdateValues(
|
||||||
_screenshot.UpdateValues(branch, location, width, height,
|
bb,
|
||||||
(int)Graphics.FromHwnd(Handle).MeasureString(
|
branch.UserText,
|
||||||
branch.UserText, _screenshot.Font, width).Height);
|
location,
|
||||||
|
width: width,
|
||||||
|
height: bb.Height,
|
||||||
|
Graphics.FromHwnd(Handle).MeasureString);
|
||||||
_screenshot.FadeIn();
|
_screenshot.FadeIn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
using System.Drawing;
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using BizHawk.Client.Common;
|
using BizHawk.Bizware.BizwareGL;
|
||||||
|
|
||||||
// We pretend it's a tooltip kind of thing, so show only the actual contents
|
// We pretend it's a tooltip kind of thing, so show only the actual contents
|
||||||
// and avoid stealing focus, while still being topmost
|
// and avoid stealing focus, while still being topmost
|
||||||
|
@ -58,15 +59,20 @@ namespace BizHawk.Client.EmuHawk
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateValues(TasBranch branch, Point location , int width, int height, int padding)
|
public void UpdateValues(
|
||||||
|
BitmapBuffer bb,
|
||||||
|
string captionText,
|
||||||
|
Point location,
|
||||||
|
int width,
|
||||||
|
int height,
|
||||||
|
Func<string, Font, int, SizeF> measureString)
|
||||||
{
|
{
|
||||||
var bb = branch.OSDFrameBuffer;
|
|
||||||
bb.DiscardAlpha();
|
bb.DiscardAlpha();
|
||||||
_bitmap = bb.ToSysdrawingBitmap();
|
_bitmap = bb.ToSysdrawingBitmap();
|
||||||
Width = width;
|
Width = width;
|
||||||
Padding = padding;
|
Padding = (int) measureString(captionText, Font, width).Height;
|
||||||
_drawingHeight = height;
|
_drawingHeight = height;
|
||||||
Text = branch.UserText;
|
Text = captionText;
|
||||||
Location = location;
|
Location = location;
|
||||||
|
|
||||||
if (Padding > 0)
|
if (Padding > 0)
|
||||||
|
|
Loading…
Reference in New Issue