textPosition and other positions don't match
in
Programming Questions
•
2 years ago
Hello,
I have a rather strange bug -- at first I thought it must be a translation somewhere but this cannot be the case.
- paramGraphic.fill(0);
- paramGraphic.ellipseMode(PConstants.RADIUS);
- paramGraphic.ellipse(0, 0, 15, 15);
- paramGraphic.text("blaaa", 0, 0);
I'm writing things into an offscreen buffer whereas a hover effect writes directly to PApplet.g, to the graphics instance used by processing. The above code to debug my application is used by the buffer and PApplet.g of processing (called for both instances).
Now it seems that the circle is overplotted whereas the text "blaaa" is not (the y-position doesn't match for about 12px) even though the x, y positions (0, 0) should be the same. I've debugged a few hours now, but still cannot imagine what might have gone wrong. At first I thought it's a translate() which doesn't match in the buffer (PGraphics instance) and the actual PApplet.g instance, but after veryfiing this it seems that this cannot be the case. The textSize and the fonts used must be the same and it looks like they are the same ;-)
Now I wonder what function can effect text positions but not other positions? Would be great if anyone has any suggestions, I'm just turning crazy ;-) I'm sorry, I can't provide a code snippet to demonstrate the problem because it's part of a bigger project (and embedded in a Swing GUI).
kind regards,
Johannes
1