Text labels bug?

Hello, I have an empty (no image) basic piece called DUMMY which just writes $TEXT$ at offset 0,0 with default aligning options. In particular: horizontal alignment = center. TEXT is a global property, default “” (empty).

Then I have a bunch of cards with a right-click command CTRL-A which sets TEXT=$BasicName$.

CTRL-A on the first card results in the string “Julia Roberts”, correctly displayed at the center of the location where the DUMMY piece was positioned.

CTRL-A on the second card writes out “Hale Berry” in place of “Julia Roberts”. However, it’s no longer horizontally centered. It’s left aligned on the starting pixel of the “J” in “Julia Roberts” written out before.

It’s like persistent memory of where to start writing the content of TEXT is stored somewhere in memory after first call.

Is this a bug?

are you stacking your cards maybe…

I have seen this too on a single piece in a score window with no stacked pieces. After changing the DP with which the label is associated, the center alignment is not updated. I don’t know if it is updated if you change the label directly (and not through a DP).

-Seth

Yes the cards are stacked. The TEXT is printed somewhere else in the same map. TEXT is a global property in that same map, which is update by a set global property trait (CTRL-A) defined on the cards.

I have tried Vassal 3.2.0 build 8015 and I can confirm that the centering “bug” is still there.

However, text labels are now making use (probably in the right way, didn’t do a through test) of the offset definitions.

For example, an empty (invisible image) piece with several text labels trait, all at default offsets (0,0) would show:

  1. in Vassal 3.1.18 as one line above the other (first text label trait being bottom line and at offset 0,0, apparently),
    but I think there is also some unpredictable behaviour when a line is set/reset to blank; moreover, defining different offsets for the various text labels seems completely buggy (-20,0 showing way high over -10,0 whereas 0,0 is right under -10,0 etc).

  2. in Vassal 3.2.0 build 8015 as all garbled in the same line, which makes sense if offset is 0,0 for all, I guess.

Bottom line: build 8015 seems to really care about the offsets, whereas 3.1.18 was messying up.
However, the centering bug (?) is still there.

The fix for 4302 was only for 3.2.

Wrong thread?

Oops, yes, that was for the other problem.

This particular issue was caused unintentionally by the change over to NamedKeyStrokes. Fixed committed to Brent-3.2@8227

Do you mean the centering issue or the offset one?

On 27/07/2012 10:14 PM, barbanera wrote:

Do you mean the centering issue or the offset one?

Offset


Brent Easton
Analyst/Programmer
University of Western Sydney
Email: b.easton@exemail.com.au

Thus spake Brent Easton:

Oops, yes, that was for the other problem.

This particular issue was caused unintentionally by the change over to
NamedKeyStrokes. Fixed committed to Brent-3.2@8227

Merged to trunk@8228, uploaded 3.2.0-svn8228.


J.

Ok, just to make it more clear to anybody reading this thread in the future: this fix (starting with 3.2.0 build 8228) DOES NOT address the text centering bug mentioned here. However, it DOES solve another issue with text labels which arised with 3.2.0 beta 1 and discussed in this other thread: [url]https://forum.vassalengine.org/t/text-labels-in-3-2-0-bug-or-feature/5144/1]

Thanks Brent!

This is following up on Barbanera’s suggestion of moving the bug discussion from (Text labels in 3.2.0: bug or feature?) to here.

From what barbanera said in that post:

I think I am seeing a similar thing in what I described. The first line of text in my module is aligned properly. The second is misaligned. Both lines contain a $FOO$ type reference, referencing a property on a property sheet.

This bug did NOT happen in 3.2.0 svn 8221 but is happening in svn8258. I have not been able to test in in the versions in between.

I want to attach my module but it is for a game that is currently being printed and I don’t want an unfinished copy of the vassal module floating around the internet before the game is printed. I’m pretty sure that actually violates something I signed with GMT Games heh. I did PM it to Uckelman but I’m not sure if he got it / has the time. Brent, if you know what is up with this bug, I’ll PM the module to you.

Hmm.

The fix that went in to the Labeler was to return the behaviour of multiple labels that have no Key Commands to be the same as it was under 3.1, to ensure existing modules keep working.

Unfortunately, it looks like you have inadvertently taken advantage of the bug and now that the bug is fixed, your module appears broken, you will need to change the parameters you have used to align the Def Tech label.

I set up a similiar thing in a test module. Try a Horizontal Position of Left with an Offset of the width of the counter. And a Horizontal text justification of Left.

Done and fixed, great job Brent you were 100% correct. I was taking advantage of a bug! Hope that never happens again. All seems to be working now. Thanks again.

That’s called optimistic solution.