2
0
Эх сурвалжийг харах

Added GadgetScaleFactor(). Fixes #15.

woollybah 6 жил өмнө
parent
commit
33765d4fc7

+ 3 - 0
maxgui.mod/gadget.bmx

@@ -638,6 +638,9 @@ Type TGadget
 	End Method
 	Method Query:Byte Ptr(queryid)
 	End Method
+	Method ScaleFactor:Int()
+		Return 1
+	End Method
 	Method CleanUp()
 		For Local tmpChild:TGadget = EachIn kids.Copy()
 			tmpChild.CleanUp()

+ 8 - 0
maxgui.mod/maxgui.bmx

@@ -2507,6 +2507,14 @@ Function QueryGadget:Byte Ptr( gadget:TGadget,queryid )
 	Return gadget.Query(queryid)
 End Function
 
+Rem
+bbdoc: Returns the gadget scale factor that maps from window coordiantes to the actual device pixels.
+about: On traditional systems this is 1, but on very high density outputs this can be a higher value (often 2).
+End Rem
+Function GadgetScaleFactor:Int( gadget:TGadget )
+	Return gadget.ScaleFactor()
+End Function
+
 Private
 
 Function GetGroup:TGadget( gadget:TGadget )