Drawing a simple slanted graphic line?

It seems to be impossible to draw a simple right-top to left-bottom graphic line in the IDE. All lines end up left-top to right-bottom, no matter how I use the mouse or edit Properties. Or am I overlooking something?
My current version: Release 2017 1.1

Thanks,
Joop Riem

Seems you are right.
Best use g.drawline in the window’s Paint event instead

[quote=376862:@Joop Riem]It seems to be impossible to draw a simple right-top to left-bottom graphic line in the IDE. All lines end up left-top to right-bottom, no matter how I use the mouse or edit Properties. Or am I overlooking something?
My current version: Release 2017 1.1

Thanks,
Joop Riem

[/quote]
This is an old bug with the Line control.

If you need to see a line in the layout editor, as opposed to drawing it in code, use the Rectangle control with the height of one pixel.

The line control is extremely buggy. I stopped using it years ago because it seemed to have a life of its own at runtime, and did not keep where I had placed it into the IDE.

I now use a canvas and drawline.

@Gavin Smith

I guess the Junior programmer handled this in Xojo’s source…? It was already almost impossible to use graphic objects in RealStudio due to vanishing visual control, and now, 10 years later, it still has issues, and so simple to correct. Shame on you, Xojo!

Your suggestion to use a Rectangle with a one pixel height isn’t the solution either. Horizontal and vertical lines are not the problem, only right slanted, which your suggestion doesn’t handle.

Until Xojo is willing to resolve this issue I am using a subclass of Line with one extra Property: ‘reversed’. In the Constructor it will swap X1 and X2, and Y1 and Y2 when this Boolean is set. In the IDE it looks very ugly because of the wrong orientation displayed.

@ Michael Bujardet

I used RealBasic and RealStudio for many years and still do. As you mentioned, it was impossible to use graphic objects in the IDE.
I did a small test in Xojo and found out that all issues in this respect seemed to be solved. Well, almost obviously…

Believe me, the line control is not to be trusted…

Interesting… while I don’t use it a lot… it seems to work fine for me… use the DIRECTION property to change the “angle” of the line

I’ll repeat what Michel said: the Line control is not to be trusted. It will let you down at random, trust us. Also, it doesn’t have a DIRECTION property, so I’m not sure what you meant.

https://documentation.xojo.com/index.php/Line

my bad… the iOS version DOES

Ah!

I too left the Line Control and use Graphics, when needed (following an advice from this forum).

This is bug:

<https://xojo.com/issue/50667>

[quote=376966:@Jason Parsley]This is bug:

<https://xojo.com/issue/50667>[/quote]

I had the line in my RubberViews demo, and after I saw it move at random, I had to remove it.

Seems indeed the issue is fixed in the next release. Thank you Jason :slight_smile: