summaryrefslogtreecommitdiff
path: root/redo/container_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-12 13:10:30 -0400
committerPietro Gagliardi <[email protected]>2014-08-12 13:10:30 -0400
commit24a42d29a54a0e607daf4e15abe915b56620bfd7 (patch)
tree289f6b556598bd3d0a98692a8919c69731f21e00 /redo/container_windows.go
parent9ecd124500298335874d9126fc79ef999dbda69a (diff)
Improved dialog base units calculations on Windows.
Diffstat (limited to 'redo/container_windows.go')
-rw-r--r--redo/container_windows.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/redo/container_windows.go b/redo/container_windows.go
index 41d7aad..5cd1877 100644
--- a/redo/container_windows.go
+++ b/redo/container_windows.go
@@ -86,6 +86,7 @@ func containerResize(data unsafe.Pointer, r *C.RECT) {
// - http://msdn.microsoft.com/en-us/library/ms645502%28VS.85%29.aspx - the calculation needed
// - http://support.microsoft.com/kb/125681 - to get the base X and Y
// (thanks to http://stackoverflow.com/questions/58620/default-button-size)
+// In my tests (see https://github.com/andlabs/windlgunits), the GetTextExtentPoint32() option for getting the base X produces much more accurate results than the tmAveCharWidth option when tested against the sample values given in http://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx#sizingandspacing, but can be off by a pixel in either direction (probably due to rounding errors).
// note on MulDiv():
// div will not be 0 in the usages below