mettli / guichan

Automatically exported from code.google.com/p/guichan
Other
0 stars 0 forks source link

text drawn outside of the TextField #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Create a TextField object with default constructor, then call the setText()
method to set some text:

TextField tf;
tf.setText("123");
//... add the 'tf' to some window to draw it on the screen

Result:
the TextField is not drawn (perhaps because its size is 0) but "123" string
IS drawn.
So, looks like "123" is drawn outside of the widget area (its width and
height is 0).

Version: guichan-0.8.0

Original issue reported on code.google.com by igagis@gmail.com on 14 May 2008 at 7:23

GoogleCodeExporter commented 9 years ago
Hmm, this is strange since it's the parent widget that sets the clipping before
calling the child's draw method. What is the parent of the TextField in your 
case?
Does clipping work for other widgets, like the gcn::Label for example?

Original comment by b.lindeijer on 15 May 2008 at 2:29

GoogleCodeExporter commented 9 years ago
The parent is gcn::Window.

I have just tried it with gcn::Label but instead of setText() I used 
setCaption()
because gcn::Label does not have setText(). And it worked OK. Maybe the problem 
is
only when using setText().

Original comment by igagis@gmail.com on 15 May 2008 at 2:37

GoogleCodeExporter commented 9 years ago
The problem was that a label with no width or height pushed a clip area with a
negative width and height to the graphics object before drawing the caption, 
and a
clip area with negative width and height wasn't ignored by the graphics object. 
It
now is.

Original comment by olof.nae...@gmail.com on 4 Aug 2008 at 8:15

GoogleCodeExporter commented 9 years ago
Shouldn't a clip area with a negative width and height cause everything to be
clipped, instead of being ignored?

Original comment by b.lindeijer on 4 Aug 2008 at 10:59

GoogleCodeExporter commented 9 years ago
Ah, never mind, I see you did that in a followup commit.

Original comment by b.lindeijer on 4 Aug 2008 at 11:00

GoogleCodeExporter commented 9 years ago
I'm really impressed how fast you are Björn! :)

Original comment by olof.nae...@gmail.com on 4 Aug 2008 at 11:17

GoogleCodeExporter commented 9 years ago
And I'm impressed by the speed at which you're handling these issues at the 
moment.
Looking forward to 0.9.0! :-)

Original comment by b.lindeijer on 5 Aug 2008 at 8:31