mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-29 01:31:34 -05:00
fix: clear empty area below items in drawing list on resize
The WM_ERASEBKGND suppression from 3c4d00b left stale artifacts
in the non-item region when the control was resized. Fill only
the area below the last visible item so items still don't flicker.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
6bed736cf0
commit
11884e712d
1 file changed
+14
@@ -152,6 +152,20 @@ namespace OpenNest.Controls
|
||||
{
|
||||
if (m.Msg == WM_ERASEBKGND)
|
||||
{
|
||||
var itemBottom = 0;
|
||||
|
||||
if (Items.Count > 0)
|
||||
{
|
||||
var lastVisible = System.Math.Min(TopIndex + (ClientSize.Height / ItemHeight), Items.Count - 1);
|
||||
itemBottom = GetItemRectangle(lastVisible).Bottom;
|
||||
}
|
||||
|
||||
if (itemBottom < ClientSize.Height)
|
||||
{
|
||||
using var g = Graphics.FromHdc(m.WParam);
|
||||
g.FillRectangle(Brushes.White, 0, itemBottom, ClientSize.Width, ClientSize.Height - itemBottom);
|
||||
}
|
||||
|
||||
m.Result = (IntPtr)1;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user