ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > JGPaiva's GridMove and Ahk Tools

Adjustments to Code for Adjusted DPI Screens and for Centering of Grid Numbers

(1/1)

SLC:
The grid was problematic for V1.19.72 when using adjusted DPI screen (e.g., Layout and scale of "150%"). The grid numbers were also off.  I made the adjustments in bold to the following portion of "creategroups:" code segment and it addressed the problems on my PC.


creategroups:
  gui,destroy
  setGuiColors()
  loop,%NGroups%
  {
    TriggerTop    := %A_Index%TriggerTop - ScreenTop
    TriggerBottom := %A_Index%TriggerBottom - ScreenTop
    TriggerLeft   := %A_Index%TriggerLeft - ScreenLeft
    TriggerRight  := %A_Index%TriggerRight - ScreenLeft
   
   ;adjustment for dpi of screen
   TriggerTop /= A_ScreenDPI/96   
   TriggerBottom /= A_ScreenDPI/96   
   TriggerLeft /= A_ScreenDPI/96   
   TriggerRight /= A_ScreenDPI/96   
   
    TriggerHeight := TriggerBottom - TriggerTop
    TriggerWidth  := TriggerRight - TriggerLeft
    GridTop       := %A_Index%GridTop
    GridLeft      := %A_Index%GridLeft
   
   
   ;Removed %A_Index% and now centering properly
    TextTop := TriggerTop - ScreenTop
    TextTop += Round(((TriggerBottom - TriggerTop) / 2 ) - 11)
    TextLeft := TriggerLeft - ScreenLeft
    TextLeft += Round(((TriggerRight - TriggerLeft) / 2) - 5)

Navigation

[0] Message Index

Go to full version