Opened 9 years ago

Closed 3 months ago

Last modified 3 months ago

#2048 closed defect (fixed)

Background refresh problem

Reported by: awrobel Owned by:
Priority: normal Milestone:
Component: wxMSW Version: dev-latest
Keywords: wxDC device coordinates translation Cc: awrobel
Blocked By: Blocking:
Patch: yes

Description

  • Start the drawing sample
  • Press F6
  • Press Ctrl-T

=> You now have green textured background

  • Resize the window to make it a bit smaller
  • Now use the scrollbars to show the areas on the right

and bottom.

=> You'll see the texture lines, but the green
background is gone.

This is a problem that I just discovered while playing
around with the sample. I could not find a reason for
this behaviour in the sample source code, so I guess
the problem is located somewhere else.

Tested with Windows 2000.

Attachments (1)

dc-clear.patch download (574 bytes) - added by awi 3 months ago.
Fix of the wxDC::Clear function

Download all attachments as: .zip

Change History (6)

comment:1 Changed 6 years ago by wojdyr

  • Keywords wxDC added
  • Status changed from new to confirmed

I can still see it in trunk (2.9) on WinXP.

comment:2 Changed 17 months ago by oneeyeman

  • Summary changed from wxMSW/2.5.3: Background refresh problem to Background refresh problem

Yes, I still see it in TRUNK on Windows 7.

Changed 3 months ago by awi

Fix of the wxDC::Clear function

comment:3 Changed 3 months ago by awi

  • Keywords device coordinates translation added
  • Patch set
  • Version set to dev-latest

This problem occurs only if wxDC::Clear function is invoked for DC of the client area of the window.
In this case coordinates of the area to be filled with background colour are not translated to device coordinates (device coordinates are different from logical coordinates due to the scrolling) and fill operation is done in the wrong location.
Translation of coordinates of the client area to device coordinates before fill operation solves the problem.

Patch attached.

comment:4 Changed 3 months ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [75730]) Fix wxClientDC::Clear() for scrolled windows in wxMSW.

Take the DC origin into account when clearing a window DC and not only a
memory one.

Closes #2048.

comment:5 Changed 3 months ago by VZ

(In [75737]) Fix wxClientDC::Clear() for scrolled windows in wxMSW.

Take the DC origin into account when clearing a window DC and not only a
memory one.

Closes #2048.

Note: See TracTickets for help on using tickets.