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

Feature/gdi minor fixes #155

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

razielanarki
Copy link
Contributor

some minor drawing related fixes:

  • #define GDIPVER 0x0110 in stdafx.h: since we're on Win7+ already (needs Vista+). (will be useful for DWrite later, and some other things)
  • some clipping/visibility related optimizations is js_panel_window.cpp
  • lax arc_width/height checks in Draw/FillUpdateRect: instead of an error, clamp arc_width/height as w/2 and h/2 respectively.


// skip redraw if the update rectangle is empty
CRect updateRect;
wnd_.GetUpdateRect( &updateRect, FALSE );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might bork the repaint, since isBgRepaintNeeded_ won't be reset to false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, that might be true, however the bg repaint would still be needed as it didn't really happen (?)

so now that i looked at the code / msdn docs for a while, it seems that isBgRepaintNeeded is set by the next case item (which is proxying from WM_ERASEBACKGROUND, and from OnSizeUser), with both cases occuring on a resize event indicating that the updateRect shouldn't be empty at all in these cases.
giving some mre tought, setting the flag here to false couldn't hurt (in the case of resizing the panel to 0 width/height)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants