PDA

View Full Version : line movement



zgulser
14th August 2009, 08:22
Hi fellas,

Imagine you have a shape like capital h which is ' H '. And now imagine that, you need to move the horizontal line between the verticals in that H. What strategy you could follow?

Thanks in advance.

wysota
14th August 2009, 08:24
What do you mean? You want a font like that or what are you saying? You don't know how to draw such a shape? QPainter::drawLine() is for drawing lines...

zgulser
14th August 2009, 09:12
What I want to mean is moving the horizontal line in 'H' between the 2 parallel lines(which are also vertical) in 'H' . H is just a metaphor obviously.

You can also think H like that; |_|. The important point is to make the horizontal line item( _ ) move ONLY between those verticals( | |).

Hope it's clear now.

wysota
14th August 2009, 09:23
Ok, but what is the problem? What is that you don't know how to do?

zgulser
14th August 2009, 09:25
Well, if the line are finite, it's cool to move the horizontal line. The problem occurs when the line are kind of indefinite or something. Catch that?

wysota
14th August 2009, 10:39
Not really... Is your problem with maths or with Qt API?

zgulser
17th August 2009, 06:37
Oh... with maths actually. I try to find the most efficient way.

Boron
17th August 2009, 18:01
Before moving the horizontal line compare its "start coordinate to be" Y value with the Y value of one of the vertical lines. If it would be outside the range the vertical lines define, don't move the horizontal line.