better handling of migration of multi line text

This commit is contained in:
hneemann 2017-07-07 13:29:13 +02:00
parent cbfa95f457
commit b454445b14
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,7 @@
Release Notes
planned as v0.13
- Added a barrel shifter (thanks to roy77)
- In case of oscillations almost all affected components are shown.
- If an error occurs, the name of the affected circuit file is shown.
- An input can have "high z" value as its default value.
@ -18,8 +19,6 @@ planned as v0.13
- Added zooming to measurement graphs.
- Test results can be displayed as measurement graphs.
- The Text component is able to show multiple lines.
CAUTION: If you modify the text in an text component created in the past, you have to
reenter the text.
v0.12.1, released on 05. Jun 2016
- added a fuse to simulate a PROM or PAL.

View File

@ -32,8 +32,13 @@ public class TextShape implements Shape {
public TextShape(ElementAttributes attr, PinDescriptions inputs, PinDescriptions outputs) {
String text = attr.get(Keys.DESCRIPTION);
if (text.length() == 0) // ToDo: used to show the text from old files.
if (text.length() == 0) { // ToDo: used to be compatible with old files. Can be removed in the future
text = attr.getLabel();
if (text.length() > 0) {
attr.set(Keys.DESCRIPTION, text);
attr.set(Keys.LABEL, "");
}
}
if (text.length() == 0)
text = Lang.get("elem_Text");