Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-08-19 Thread Jeremy Moles
On Fri, 2011-08-19 at 15:31 +0200, Daniel Cámpora wrote: > Hi, > > I had the same problem and ended up overriding the _calculateSize method as > you are doing. > > However, I don't think this is an error of the bounding box. What happens > internally is that the text has a width and height acco

Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-08-19 Thread Daniel Cámpora
Hi, I had the same problem and ended up overriding the _calculateSize method as you are doing. However, I don't think this is an error of the bounding box. What happens internally is that the text has a width and height according to the first text that we fit in, and it's only updated IF the t

Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-08-12 Thread Yue Zijian
Jeremy Moles wrote: > > This is probably the bug where the bounding box of the Text isn't > proper; what version of OSG are you using? > Hi Jeremy Moles, OSG 3.0.1, thank you! :) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42044#42044 _

Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-08-12 Thread Jeremy Moles
On Fri, 2011-08-12 at 11:09 +0200, Yue Zijian wrote: > [code] > #include > #include > #include > > const unsigned int MASK_2D = 0xF000; > > > int main(int argc, char** argv) { > osgViewer::Viewer viewer; > > osgWidget::WindowManager* wm = new osgWidget::WindowManager( > &

Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-08-12 Thread Yue Zijian
[code] #include #include #include const unsigned int MASK_2D = 0xF000; int main(int argc, char** argv) { osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( &viewer, 1280.0f, 1024.0f, MASK_2D, osgWidget::W

Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-02-22 Thread Jeremy Moles
On Tue, 2011-02-22 at 16:19 +0100, Gianni Ambrosio wrote: > Dear Jeremy Moles, > is there a reason for not updating the size of the Label if smaller than > previous one? In my own testing back when I wrote it I never had any problems, but then again osgText has changed a lot since then. If you ca

Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-02-22 Thread Gianni Ambrosio
Dear Jeremy Moles, is there a reason for not updating the size of the Label if smaller than previous one? Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36966#36966 ___ osg-users mail

Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-02-18 Thread Ramy Gowigati
It frustrated me for a few hours trying to fix that. I'm glad its working now. :D Cheers, Ramy -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36807#36807 ___ osg-users mailing list osg-users@lists.

Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-02-18 Thread Gianni Ambrosio
ramy wrote: > > Maybe thats your problem? Exactly Ramy, in fact the _calculateSize() is the point as you noticed. Thanks for confirming that. I'm using the same OSG version ;) Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36805#36805

Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-02-18 Thread Ramy Gowigati
Hi, i had a similar problem with the Label not resizing (shrinking). It resized properly when the new size was bigger than existing, but it does not want to get smaller. So I just overrided the _calculateSize() in osgWidget::Label and removed the two IF statements. and I must add Im using OSG

Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-02-18 Thread Gianni Ambrosio
Hi All, is it the problem not clear or impossible to solve? I thought it was simple. Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36786#36786 ___ osg-users mailing list osg-users@lists.opens

Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-02-16 Thread Gianni Ambrosio
The problem now is as follows.` I have the following code: label = new osgWidget::Label; label->setLabel("1234"); label->setPadding(10.0f); label->addSize(21.0f, 22.0f); window = new osgWidget::Canvas; window->addWidget(label); window->setUpdateCallback(new AnimatedUpdateC

Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-02-15 Thread Gianni Ambrosio
OK, I realized I have to call the canvas resize also. Even if I have a strange behaviour ... Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36697#36697 ___ osg-users mailing list osg-users@li

[osg-users] osgWidget::Label::setLabel() does not update the size

2011-02-15 Thread Gianni Ambrosio
Hi All, I have the following code: label = new osgWidget::Label(iName, "123"); label->setColor(1.0f, 0.0f, 0.0f, 1.0f); label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f); window = new osgWidget::Canvas; window->addWidget(label); window->setUpdateCallback(new AnimatedUpdateCallback(t