Merge pull request #20 from djes/thyphoon
Thyphoon desktop centering fixes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
|
|
||||||
PBMap.pb.bak
|
PBMap.pb.bak
|
||||||
*.exe
|
*.exe
|
||||||
|
24
PBMap.pb
24
PBMap.pb
@@ -2037,7 +2037,7 @@ Module PBMap
|
|||||||
Protected Text.s = "© OpenStreetMap contributors"
|
Protected Text.s = "© OpenStreetMap contributors"
|
||||||
VectorFont(FontID(*PBMap\StandardFont), 12)
|
VectorFont(FontID(*PBMap\StandardFont), 12)
|
||||||
VectorSourceColor(RGBA(0, 0, 0, 80))
|
VectorSourceColor(RGBA(0, 0, 0, 80))
|
||||||
MovePathCursor(GadgetWidth(*PBMap\Gadget) - VectorTextWidth(Text), GadgetHeight(*PBMap\Gadget) - 20)
|
MovePathCursor(DesktopScaledX(GadgetWidth(*PBMap\Gadget)) - VectorTextWidth(Text), GadgetHeight(*PBMap\Gadget) - 20)
|
||||||
DrawVectorText(Text)
|
DrawVectorText(Text)
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
@@ -2052,8 +2052,8 @@ Module PBMap
|
|||||||
*PBMap\Dirty = #False
|
*PBMap\Dirty = #False
|
||||||
*PBMap\Redraw = #False
|
*PBMap\Redraw = #False
|
||||||
; *** Precalc some values
|
; *** Precalc some values
|
||||||
*Drawing\RadiusX = GadgetWidth(*PBMap\Gadget) / 2
|
*Drawing\RadiusX = DesktopScaledX(GadgetWidth(*PBMap\Gadget)) / 2
|
||||||
*Drawing\RadiusY = GadgetHeight(*PBMap\Gadget) / 2
|
*Drawing\RadiusY = DesktopScaledY(GadgetHeight(*PBMap\Gadget)) / 2
|
||||||
*Drawing\GeographicCoordinates\Latitude = *PBMap\GeographicCoordinates\Latitude
|
*Drawing\GeographicCoordinates\Latitude = *PBMap\GeographicCoordinates\Latitude
|
||||||
*Drawing\GeographicCoordinates\Longitude = *PBMap\GeographicCoordinates\Longitude
|
*Drawing\GeographicCoordinates\Longitude = *PBMap\GeographicCoordinates\Longitude
|
||||||
LatLon2TileXY(*Drawing\GeographicCoordinates, *Drawing\TileCoordinates, *PBMap\Zoom)
|
LatLon2TileXY(*Drawing\GeographicCoordinates, *Drawing\TileCoordinates, *PBMap\Zoom)
|
||||||
@@ -2107,10 +2107,10 @@ Module PBMap
|
|||||||
DrawDebugInfos(MapGadget, *Drawing)
|
DrawDebugInfos(MapGadget, *Drawing)
|
||||||
EndIf
|
EndIf
|
||||||
If *PBMap\Options\ShowScale
|
If *PBMap\Options\ShowScale
|
||||||
DrawScale(MapGadget, *Drawing, 10, GadgetHeight(*PBMap\Gadget) - 20, 192)
|
DrawScale(MapGadget, *Drawing, 10, DesktopScaledY(GadgetHeight(*PBMap\Gadget)) - 20, 192)
|
||||||
EndIf
|
EndIf
|
||||||
If *PBMap\Options\ShowZoom
|
If *PBMap\Options\ShowZoom
|
||||||
DrawZoom(MapGadget, GadgetWidth(*PBMap\Gadget) - 30, 5) ; ajout YA - affiche le niveau de zoom
|
DrawZoom(MapGadget, DesktopScaledX(GadgetWidth(*PBMap\Gadget)) - 30, 5) ; ajout YA - affiche le niveau de zoom
|
||||||
EndIf
|
EndIf
|
||||||
If OSMCopyright
|
If OSMCopyright
|
||||||
DrawOSMCopyright(MapGadget, *Drawing)
|
DrawOSMCopyright(MapGadget, *Drawing)
|
||||||
@@ -2490,8 +2490,8 @@ Module PBMap
|
|||||||
; StopVectorDrawing()
|
; StopVectorDrawing()
|
||||||
Select EventType()
|
Select EventType()
|
||||||
Case #PB_EventType_Focus
|
Case #PB_EventType_Focus
|
||||||
*PBMap\Drawing\RadiusX = GadgetWidth(*PBMap\Gadget) / 2
|
*PBMap\Drawing\RadiusX = DesktopScaledX(GadgetWidth(*PBMap\Gadget)) / 2
|
||||||
*PBMap\Drawing\RadiusY = GadgetHeight(*PBMap\Gadget) / 2
|
*PBMap\Drawing\RadiusY = DesktopScaledY(GadgetHeight(*PBMap\Gadget)) / 2
|
||||||
Case #PB_EventType_KeyUp
|
Case #PB_EventType_KeyUp
|
||||||
Select GetGadgetAttribute(*PBMap\Gadget, #PB_Canvas_Key)
|
Select GetGadgetAttribute(*PBMap\Gadget, #PB_Canvas_Key)
|
||||||
Case #PB_Shortcut_Delete
|
Case #PB_Shortcut_Delete
|
||||||
@@ -2808,8 +2808,8 @@ Module PBMap
|
|||||||
BindGadgetEvent(*PBMap\Gadget, @CanvasEvents())
|
BindGadgetEvent(*PBMap\Gadget, @CanvasEvents())
|
||||||
AddWindowTimer(*PBMap\Window, *PBMap\Timer, *PBMap\Options\TimerInterval)
|
AddWindowTimer(*PBMap\Window, *PBMap\Timer, *PBMap\Options\TimerInterval)
|
||||||
BindEvent(#PB_Event_Timer, @TimerEvents())
|
BindEvent(#PB_Event_Timer, @TimerEvents())
|
||||||
*PBMap\Drawing\RadiusX = GadgetWidth(*PBMap\Gadget) / 2
|
*PBMap\Drawing\RadiusX = DesktopScaledX(GadgetWidth(*PBMap\Gadget)) / 2
|
||||||
*PBMap\Drawing\RadiusY = GadgetHeight(*PBMap\Gadget) / 2
|
*PBMap\Drawing\RadiusY = DesktopScaledY(GadgetHeight(*PBMap\Gadget)) / 2
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
; Creates a canvas and attach our map
|
; Creates a canvas and attach our map
|
||||||
@@ -2873,8 +2873,10 @@ EndModule
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
; IDE Options = PureBasic 5.73 LTS (Windows - x64)
|
|
||||||
; CursorPosition = 35
|
; IDE Options = PureBasic 6.00 Alpha 3 (Windows - x64)
|
||||||
|
; CursorPosition = 2657
|
||||||
|
; FirstLine = 766
|
||||||
; Folding = --------------------
|
; Folding = --------------------
|
||||||
; EnableThread
|
; EnableThread
|
||||||
; EnableXP
|
; EnableXP
|
Reference in New Issue
Block a user