← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2273: use the right bg color when taking rich edit snapshots

 

------------------------------------------------------------
revno: 2273
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-10-29 15:05:05 +0200
message:
  use the right bg color when taking rich edit snapshots
modified:
  dwt/src/widgets/RichTextBox.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dwt/src/widgets/RichTextBox.cpp'
--- dwt/src/widgets/RichTextBox.cpp	2010-10-28 21:28:09 +0000
+++ dwt/src/widgets/RichTextBox.cpp	2010-10-29 13:05:05 +0000
@@ -85,16 +85,16 @@
 	/* unlike other common controls, Rich Edits ignore WM_PRINTCLIENT messages. as per
 	<http://msdn.microsoft.com/en-us/library/bb787875(VS.85).aspx>, we have to handle the printing
 	by ourselves. this is crucial for taskbar thumbnails and "Aero Peek" previews. */
-	onPrinting([this](Canvas& canvas) {
+	onPrinting([this, cs](Canvas& canvas) {
 		Rectangle rect(getClientSize());
 
 		// paint a background in case the text doesn't span the whole box.
-		canvas.fill(rect, Brush(Brush::Window));
+		canvas.fill(rect, Brush(cs.backgroundColor));
 
 		::FORMATRANGE format = { canvas.handle(), canvas.handle() };
 		format.rc = rect;
-		format.rc.right *= ::GetDeviceCaps(canvas.handle(), LOGPIXELSX);
-		format.rc.bottom *= ::GetDeviceCaps(canvas.handle(), LOGPIXELSY);
+		format.rc.right *= canvas.getDeviceCaps(LOGPIXELSX);
+		format.rc.bottom *= canvas.getDeviceCaps(LOGPIXELSY);
 		format.rcPage = format.rc;
 		format.chrg.cpMin = 0;
 		format.chrg.cpMax = -1;