Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skin: Graphic artifacts when switching selected buttons #1646

Closed
itsmedavep opened this issue Mar 20, 2020 · 8 comments · Fixed by #2187
Closed

Skin: Graphic artifacts when switching selected buttons #1646

itsmedavep opened this issue Mar 20, 2020 · 8 comments · Fixed by #2187
Labels
UI Issues related to UI look&feel
Milestone

Comments

@itsmedavep
Copy link
Contributor

Not sure when this cropped up but I am seeing it on both the light and dark skins.

graphic_artifacts

macOS Mojave. 150% zoom but visible at all zoom level except 100%.

Essentially when the graphics files touch the extents of the clipping area there are some parts of it the dont appear to be getting redrawn when selecting a differing control.

@baconpaul
Copy link
Collaborator

So I can confirm this booger both here and in the filter dialog per @mkruselj report on slack. Looking. Not exactly sure what it is yet.

@baconpaul
Copy link
Collaborator

and I can't for the life of me figure it out. Harumph. I thought it was the clip 0.01 shenanigans in CScalableBitmap but it isnt

@baconpaul
Copy link
Collaborator

The crazy thing with poly is the only one it sticks on is the one which is set when you do the rebuild.So like select MONO FP and your booger is (wherever) no do scene b scene a and there is no booger. Check POLY and the booger is now on MONO FP

So something about the initial draw is misaligned by a smidge.

Screen Shot 2020-04-10 at 10 13 18 AM

And if you zoom up you can see the smidge is exactly one pixel

So somewhere between the draw-at-rebuild and the redraw is a one pixel jiggle.

Double harumph. I will get this, but I won't get it today.

@baconpaul
Copy link
Collaborator

Interestingly you can see there that the selected one is also drawn off by one pixel just you don't notice because the leftover goobit is the almost black line. I wonder if the whole draw is shifting by one px between build and redraw.

(Why on earth would that happen).

@mkruselj mkruselj added the UI Issues related to UI look&feel label Apr 11, 2020
@baconpaul
Copy link
Collaborator

OK so the draw when we rebuild has cliprect == viewrect
The draw when we hover or click without a rebuild has cliprect < viewrect by a smidge

VIEW (x=239,y=87)+(w=50,h=47)
CLIP (x=239.259,y=87)+(w=49.6296,h=47)

that's at 130% on my mac or some such.

@baconpaul
Copy link
Collaborator

sigh so i tried a call to makeIntegral inside cviewcontainer and that made the clip rectangle the right size but didn't kill the broken pixel :(

@baconpaul
Copy link
Collaborator

Sigh
This isn't a painting problem I don't think
it is an invalidation problem
that is: the widget invalidates too small a region when zoomed
probably due to some rounding error

@baconpaul
Copy link
Collaborator

yeah ha that's exactly it

If I do

void CView::invalidRect (const CRect& rect)
{
   CRect fr = rect;
   fr.extend(1,1);
	if (isAttached () && hasViewFlag (kVisible))
	{
		vstgui_assert (pImpl->parentView);
		pImpl->parentView->invalidRect (fr);
	}
}

then no edge boogers. I don't think that's the permanent solution but I'm suer close now.

baconpaul added a commit to baconpaul/surge that referenced this issue Jun 23, 2020
See the comment in vstgui.surge for the fix
Closes surge-synthesizer#1646
Closes surge-synthesizer#1923
baconpaul added a commit that referenced this issue Jun 23, 2020
See the comment in vstgui.surge for the fix
Closes #1646
Closes #1923
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI Issues related to UI look&feel
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants