Skip to content

Graphical artifacts from selection squares in esc-demo snip #59

Answered by alex-hhh
bmitc asked this question in Q&A
Discussion options

You must be logged in to vote

The artifacts are created by the "selection handles" which are drawn by the pasteboard. You can easily verify that by disabling them using (send pb set-selection-visible #f).

The artifacts happen because the draw method of the snip changes the dc to draw in "smoothed" mode and never restores the old state, but the pasteboard draws the handles expecting them to be unsmoothed, yet it never explicitly setting this state.

The patch below will resolve the issue, it updates the draw method of the snip to save the old smoothing state and restore it after the draw -- in general it is a good idea to do this for all drawing parameters used by a draw method (e.g. pens, brushes, etc), but it is somet…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bmitc
Comment options

@alex-hhh
Comment options

@bmitc
Comment options

Answer selected by alex-hhh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants