[vtk-developers] Help with vtkFreeTypeTools::MapTextPropertyToId error...

Sean McBride sean at rogue-research.com
Wed Mar 25 13:07:52 EDT 2015


Hi all,

Anyone know vtkFreeTypeTools::MapTextPropertyToId?

This test failure:
<https://open.cdash.org/testDetails.php?test=314508353&build=3741998>

vtkFreeTypeTools.cxx:634:71: runtime error: left shift of negative value -450

Is happening because the author is assuming vtkTextProperty's GetOrientation() returns an angle between 0 and 360:

 int angle = (vtkMath::Round(tprop->GetOrientation() * 10.0) % 3600) << bits;

when in fact the returned angle can (apparently) be negative.

Questions:

1) vtkTextProperty's GetOrientation() docs say only "Set/Get the text's orientation (in degrees)."  I guess any range is correct?

2) is there a utility function somewhere to constrain an angle to 0->360?  I could not find one...

Thanks,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the vtk-developers mailing list