Problem with text and text background when clipping

Mac OSX specific forum
coco2
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Problem with text and text background when clipping

Post by coco2 »

I'm having strange behaviour trying to clip inside a canvas on my Mac. Is this something I'm doing or is it a bug?

The problem looks like the text background is in one place, and the text appears 10 pixels up and to the left which corresponds to the clip region values.

Code: Select all

OpenWindow(0, 0, 0, 400, 400, "Test", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 400, 400)
LoadFont(0, "Arial", 18)
StartDrawing(CanvasOutput(0))
DrawingFont(FontID(0))
ClipOutput(10, 10, 400, 400)
DrawText(50, 50, "Test", #Green, #Blue)
StopDrawing()
Repeat
  event = WaitWindowEvent(10)
Until event = #PB_Event_CloseWindow
User avatar
mk-soft
Always Here
Always Here
Posts: 6245
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Problem with text and text background when clipping

Post by mk-soft »

Do everything as it should, ClipOutput limits the output range

Code: Select all

OpenWindow(0, 0, 0, 400, 400, "Test", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 400, 400)
LoadFont(0, "Arial", 24)
StartDrawing(CanvasOutput(0))
DrawingFont(FontID(0))
DrawText(10, 10, "I like PureBasic!", #Blue, #Green)
h = TextHeight("X")
ClipOutput(10, 10 + h/2, 400, 400)
DrawText(10, 10, "I like PureBasic!", #Green, #Blue)
StopDrawing()
Repeat
  event = WaitWindowEvent(10)
Until event = #PB_Event_CloseWindow
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
coco2
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Re: Problem with text and text background when clipping

Post by coco2 »

This is what I get:
https://imgur.com/DjxdH4y
User avatar
mk-soft
Always Here
Always Here
Posts: 6245
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Problem with text and text background when clipping

Post by mk-soft »

Added PB-Version, macOS Version, HW and Monitor settings for Bugreport
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
coco2
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Re: Problem with text and text background when clipping

Post by coco2 »

PureBasic 6.04 LTS macOS arm64
macOS version: 14.5
Hardware: Mac Mini
CPU: M2
Cores: 8C CPU, 10C GPU
RAM: 8GB
HDD: 256GB
Model no.: A2686
Monitor: 1080P
coco2
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Re: Problem with text and text background when clipping

Post by coco2 »

I updated to version 6.11 and there's no problem now
Post Reply