@Override public void drawTextNode(NodeModel objectModel) { Node node = objectModel.getNode(); TextProperties textData = (TextProperties) node.getTextProperties(); if (textData != null) { String txt = textData.getText(); float width, height, posX, posY; if (txt == null || txt.isEmpty()) { return; } float sizeFactor = drawable.getGlobalScale() * textData.getSize() * model.sizeMode.getSizeFactor3d(model.nodeSizeFactor, objectModel); if (nodeRefresh || (objectModel.getTextWidth() == 0f && objectModel.getTextHeight() == 0f)) { Rectangle2D r = renderer.getBounds(txt); width = (float) (sizeFactor * r.getWidth()); height = (float) (sizeFactor * r.getHeight()); posX = node.x() + (float) width / -2f; posY = node.y() + (float) height / -2f; textData.setDimensions(width, height); } else { width = textData.getWidth(); height = textData.getHeight(); posX = node.x() + (float) width / -2f; posY = node.y() + (float) height / -2f; } model.colorMode.textNodeColor(this, objectModel); renderer.draw3D(txt, posX, posY, (float) node.z(), sizeFactor); } }
textData.setDimensions(width, height); } else { width = textData.getWidth();