parent
6ad50db01b
commit
6a89b33816
|
@ -218,8 +218,15 @@ void ViewProviderAnnotation::updateData(const App::Property* prop)
|
||||||
pLabel->string.setNum((int)lines.size());
|
pLabel->string.setNum((int)lines.size());
|
||||||
pLabel3d->string.setNum((int)lines.size());
|
pLabel3d->string.setNum((int)lines.size());
|
||||||
for (std::vector<std::string>::const_iterator it = lines.begin(); it != lines.end(); ++it) {
|
for (std::vector<std::string>::const_iterator it = lines.begin(); it != lines.end(); ++it) {
|
||||||
|
#if (COIN_MAJOR_VERSION <= 3)
|
||||||
|
QByteArray latin1str;
|
||||||
|
latin1str = (QString::fromUtf8(it->c_str())).toLatin1();
|
||||||
|
pLabel->string.set1Value(index, SbString(latin1str.constData()));
|
||||||
|
pLabel3d->string.set1Value(index, SbString(latin1str.constData()));
|
||||||
|
#else
|
||||||
pLabel->string.set1Value(index, SbString(it->c_str()));
|
pLabel->string.set1Value(index, SbString(it->c_str()));
|
||||||
pLabel3d->string.set1Value(index, SbString(it->c_str()));
|
pLabel3d->string.set1Value(index, SbString(it->c_str()));
|
||||||
|
#endif
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -891,11 +891,8 @@ def makeText(stringslist,point=Vector(0,0,0),screen=False):
|
||||||
If screen is True, the text always faces the view direction.'''
|
If screen is True, the text always faces the view direction.'''
|
||||||
typecheck([(point,Vector)], "makeText")
|
typecheck([(point,Vector)], "makeText")
|
||||||
if not isinstance(stringslist,list): stringslist = [stringslist]
|
if not isinstance(stringslist,list): stringslist = [stringslist]
|
||||||
textbuffer = []
|
|
||||||
for l in stringslist:
|
|
||||||
textbuffer.append(stringencodecoin(l.decode("utf8")))
|
|
||||||
obj=FreeCAD.ActiveDocument.addObject("App::Annotation","Text")
|
obj=FreeCAD.ActiveDocument.addObject("App::Annotation","Text")
|
||||||
obj.LabelText=textbuffer
|
obj.LabelText=stringlist
|
||||||
obj.Position=point
|
obj.Position=point
|
||||||
if FreeCAD.GuiUp:
|
if FreeCAD.GuiUp:
|
||||||
if not screen:
|
if not screen:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user