Search found 2 matches

by greycheek
Tue Apr 09, 2024 6:34 pm
Forum: Coding Questions
Topic: Vector Drawing
Replies: 6
Views: 1455

Re: Vector Drawing

x1 = (GetGadgetAttribute(Canvas_0, #PB_Canvas_MouseX) / pw) * pw
y1 = (GetGadgetAttribute(Canvas_0, #PB_Canvas_MouseY) / ph) * ph

These two lines of code capture the mouse position that will be used to draw back to the origin (x,y). The division and multiplication is used to round off to the ...
by greycheek
Tue Apr 09, 2024 6:07 pm
Forum: Coding Questions
Topic: Vector Drawing
Replies: 6
Views: 1455

Vector Drawing

The following code does not produce a vector line, or anything on the canvas. Foŕthe life of me I don't know what I'm doing wrong. Any insights?

Procedure VectorLine(color,x,y,pw,ph,brush_width)
If StartVectorDrawing(CanvasVectorOutput(Canvas_0))
Repeat
x1 = (GetGadgetAttribute(Canvas_0, #PB ...