It is currently Thu Nov 26, 2020 8:31 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [Done] DesktopScaled[X/Y] calculation bug
PostPosted: Thu Feb 27, 2020 9:46 am 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2730
Location: Germany
The result of DesktopScaledXY is an overflow when passing negative values

PB v5.70, v5.71, v5.72b1

Code:
dx = DesktopScaledX(-1)
dy = DesktopScaledY(-1)
Debug "dx = " + dx + " dy = " + dy


Code:
Global.d dx, dy

Procedure UpdateWindow()
  ResizeGadget(0, 10, 10, WindowWidth(0) - 20, WindowHeight(0) - 20)
  dx = DesktopScaledX(GadgetWidth(0))
  dy = DesktopScaledY(GadgetHeight(0))
  Debug "dx = " + dx + " dy = " + dy
EndProcedure


Procedure Main()
  If OpenWindow(0, 100, 100, 400, 300, "Window", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
    CanvasGadget(0, 10, 10, 380, 280, #PB_Canvas_Border)
   
    BindEvent(#PB_Event_SizeWindow, @UpdateWindow())
   
    Repeat
      Select WaitWindowEvent()
        Case #PB_Event_Menu
          Select EventMenu()
              CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
              Case #PB_Menu_Quit
                Break
              CompilerEndIf
          EndSelect
         
        Case #PB_Event_CloseWindow
          Break
         
      EndSelect
    ForEver
   
  EndIf
 
EndProcedure : Main()

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: DesktopScaled[X/Y] calculation bug
PostPosted: Sat Feb 29, 2020 10:22 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14179
Location: France
Fixed.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye