Problem with Draw

Windows specific questions.
Post Reply
Carlos Herrera
Posts: 82
Joined: Nov 28, 2011 13:29
Location: Dictatorship

Problem with Draw

Post by Carlos Herrera »

Hi All,
Minimal program below illustrates the problem

Code: Select all

#Include "fbgfx.bi"
Const red = &HAA0000, grey = &HAAAAAA, white = &HFFFFFF
Screenres 500, 500, 32
View (100,50)-(400, 400), white, grey
Line (0, 0)-(350, 350),grey,B
' draw line with Line
Line (10,10) - (300, 300), red
' draw the same line (different color) with Draw
Draw "C2" 
Draw "BM 10,10 M 300,300"
Sleep
Screen 0
With View command the clipping region and zero-shift is defined. Line follows those rules,
however, Draw seems to ignore that the origin of reference frame is shifted. On win10
I see two parallel lines instead of one. Is it Draw-bug or drawback?
Carlos
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Problem with Draw

Post by MrSwiss »

Carlos Herrera wrote:Is it Draw-bug or drawback?
NOT a bug, expected behaviour ...
Line is affected by View, Draw is not (details, in FB-Documentation).
Carlos Herrera
Posts: 82
Joined: Nov 28, 2011 13:29
Location: Dictatorship

Re: Problem with Draw

Post by Carlos Herrera »

MrSwiss wrote: Line is affected by View, Draw is not
If you change colour of the line which is drawn with Draw command, you will see that it is not visible outside
the white rectangle. It means that Draw is affected by View, but so-to-say partly...
BTW, on VIEW (GRAPHICS) page Draw command is not mentioned and on DRAW page View command
is not mentioned also.
Carlos
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Problem with Draw

Post by MrSwiss »

However, on Line page View (and Window) are mentioned.

The difference is Not in visibility, but in coordinates: absolute to view vs. absolute to gfx-window.
fxm
Moderator
Posts: 12108
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Problem with Draw

Post by fxm »

The clipping function of 'View ( x1, y1 )-( x2, y2 ) [ [, fill_color ] [, border_color ] ]' is always active on any graphic (including 'Draw').
But there is no impact on coordinates of 'Draw'.

I will update documentation.
fxm
Moderator
Posts: 12108
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Problem with Draw

Post by fxm »

Done:
KeyPgDraw → fxm [DRAW only respects the clipping region set by VIEW (Graphics), its coordinates are not affected by the custom coordinates system]
KeyPgDrawString → fxm [DRAW STRING coordinates are affected by custom coordinates system set via WINDOW and VIEW (Graphics) statements, and the drawn text respects clipping rectangle set by VIEW (Graphics)]
Post Reply