Graphics.DrawLine wrong drawing when adjusting PenSize

Feedback Case Number: https://tracker.xojo.com/xojoinc/xojo/-/issues/69965

With the Graphics.Drawline method, as the pen size grows the start point of a line moves.

Please add your thumbs up to this case, it has to be fixed ASAP.

Really funny effect…

Here is a workaround until the issue is fixed:

Sub Paint(g As Graphics, areas() As Rect) Handles Paint
  
  g.DrawingColor = Color.White
  g.FillRectangle 0, 0, g.Width, g.Height
  
  g.DrawingColor = Color.Red
  g.LineCap = Graphics.LineCapTypes.■■■■
  g.PenSize = slider1.Value
  g.DrawLine 10 - g.PenSize/2, 20, g.Width - 20 - g.PenSize/2, 20
End Sub

PS: Great when Xojo Language words are censored in forum

Though I appreciate your reply, it is not fun anymore when the volume of support requests from customers increases weekly because of these old bugs in Xojo.

My current big graphics module looks something like this:

if (targetMacOS & printing)
applyCrazyWorkaround1()

elseif onScreen
applyCrazyWorkaround2()

elseif (targetWindows & drawingArcs)
doSomethingCompletelyDifferent()

Not exactly nice to code and maintain, so please everybody add a thumbs-up to the case.

Is the word BUT*T ?

Try the other word that also mean strange (hint: starts <ith a ‘q’)…

A magazine with that name exists for that community… according to wikipedia…

everything is ok
if you want to draw in the middle you should too
the vertical values have to be adjusted

g.DrawLine 50 - g.PenSize/2, 50- g.PenSize/2, g.Width - 50 - g.PenSize/2, 50- g.PenSize/2

1 Like