• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28265 (tree)
Time2018-07-06 23:15:46
Authorcsware

Log Message

Follow up for rev. #28237: High DPI improvements

Change Summary

Incremental Difference

--- trunk/src/TortoiseMerge/AboutDlg.cpp (revision 28264)
+++ trunk/src/TortoiseMerge/AboutDlg.cpp (revision 28265)
@@ -1,4 +1,4 @@
1-// TortoiseMerge - a Diff/Patch program
1+// TortoiseMerge - a Diff/Patch program
22
33 // Copyright (C) 2006-2007, 2009-2010, 2013-2014, 2016-2017 - TortoiseSVN
44
@@ -24,6 +24,7 @@
2424 #include "../../apr/include/apr_version.h"
2525 #include "../../apr-util/include/apu_version.h"
2626 #include "../version.h"
27+#include "../Utils/DPIAware.h"
2728
2829 // CAboutDlg dialog
2930
@@ -73,10 +74,10 @@
7374
7475 CPictureHolder tmpPic;
7576 tmpPic.CreateFromBitmap(IDB_LOGOFLIPPED);
76- m_renderSrc.Create32BitFromPicture(&tmpPic,468,64);
77- m_renderDest.Create32BitFromPicture(&tmpPic,468,64);
77+ m_renderSrc.Create32BitFromPicture(&tmpPic, CDPIAware::Instance().Scale(468), CDPIAware::Instance().Scale(64));
78+ m_renderDest.Create32BitFromPicture(&tmpPic, CDPIAware::Instance().Scale(468), CDPIAware::Instance().Scale(64));
7879
79- m_waterEffect.Create(468,64);
80+ m_waterEffect.Create(CDPIAware::Instance().Scale(468), CDPIAware::Instance().Scale(64));
8081 SetTimer(ID_EFFECTTIMER, 40, nullptr);
8182 SetTimer(ID_DROPTIMER, 300, nullptr);
8283
@@ -93,14 +94,14 @@
9394 {
9495 m_waterEffect.Render((DWORD*)m_renderSrc.GetDIBits(), (DWORD*)m_renderDest.GetDIBits());
9596 CClientDC dc(this);
96- CPoint ptOrigin(15,20);
97+ CPoint ptOrigin(CDPIAware::Instance().Scale(15), CDPIAware::Instance().Scale(20));
9798 m_renderDest.Draw(&dc,ptOrigin);
9899 }
99100 if (nIDEvent == ID_DROPTIMER)
100101 {
101102 CRect r;
102- r.left = 15;
103- r.top = 20;
103+ r.left = CDPIAware::Instance().Scale(15);
104+ r.top = CDPIAware::Instance().Scale(20);
104105 r.right = r.left + m_renderSrc.GetWidth();
105106 r.bottom = r.top + m_renderSrc.GetHeight();
106107 m_waterEffect.Blob(random(r.left,r.right), random(r.top, r.bottom), 2, 400, m_waterEffect.m_iHpage);
@@ -110,9 +111,11 @@
110111
111112 void CAboutDlg::OnMouseMove(UINT nFlags, CPoint point)
112113 {
114+ auto dpix15 = CDPIAware::Instance().Scale(15);
115+ auto dpiy20 = CDPIAware::Instance().Scale(20);
113116 CRect r;
114- r.left = 15;
115- r.top = 20;
117+ r.left = dpix15;
118+ r.top = dpiy20;
116119 r.right = r.left + m_renderSrc.GetWidth();
117120 r.bottom = r.top + m_renderSrc.GetHeight();
118121
@@ -119,13 +122,13 @@
119122 if(r.PtInRect(point) != FALSE)
120123 {
121124 // dibs are drawn upside down...
122- point.y -= 20;
123- point.y = 64-point.y;
125+ point.y -= dpiy20;
126+ point.y = CDPIAware::Instance().Scale(64) - point.y;
124127
125128 if (nFlags & MK_LBUTTON)
126- m_waterEffect.Blob(point.x -15,point.y,5,1600,m_waterEffect.m_iHpage);
129+ m_waterEffect.Blob(point.x - dpix15, point.y, CDPIAware::Instance().Scale(10), 1600, m_waterEffect.m_iHpage);
127130 else
128- m_waterEffect.Blob(point.x -15,point.y,2,50,m_waterEffect.m_iHpage);
131+ m_waterEffect.Blob(point.x - dpix15, point.y, CDPIAware::Instance().Scale(5), 50, m_waterEffect.m_iHpage);
129132
130133 }
131134
Show on old repository browser