-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tastudio: don't let branch screenshot appear below screen edge
- Loading branch information
1 parent
28757bd
commit 05f06ae
Showing
2 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,11 @@ | |
using System.IO; | ||
using System.Linq; | ||
using System.Windows.Forms; | ||
|
||
using BizHawk.Client.Common; | ||
using BizHawk.Emulation.Common; | ||
using BizHawk.Client.EmuHawk.Properties; | ||
using BizHawk.Common.CollectionExtensions; | ||
using BizHawk.Emulation.Common; | ||
|
||
namespace BizHawk.Client.EmuHawk | ||
{ | ||
|
@@ -651,12 +652,25 @@ private void BranchView_PointedCellChanged(object sender, InputRoll.CellEventArg | |
var bb = branch.OSDFrameBuffer; | ||
var width = bb.Width; | ||
Point location = PointToScreen(Location); | ||
var bottom = location.Y + bb.Height; | ||
location.Offset(-width, 0); | ||
|
||
if (location.X < 0) | ||
{ | ||
// show on the right of branch control | ||
location.Offset(width + Width, 0); | ||
} | ||
|
||
Math.Max(0, location.Y); | ||
var screen = Screen.AllScreens.Where(s => s.WorkingArea.Contains(location)).FirstOrDefault(); | ||
Check failure on line 665 in src/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs GitHub Actions / Build solution with analyzers
|
||
var h = screen.WorkingArea.Bottom - bottom; | ||
|
||
if (h < 0) | ||
{ | ||
// move up to become fully visible | ||
location.Y += h; | ||
} | ||
|
||
_screenshot.UpdateValues( | ||
bb, | ||
branch.UserText, | ||
|