Community
Participate
Working Groups
Build Identifier: 20100617-1415 Today I tried to work with the "MatchingCharacterPainter". I used my own "ICharacterPairMatcher" class, and provided a "IRegion" to paint. The region hadn't length of 1 but 3 in this case. I tried to look into the stack trace and saw that the method: "private void handleDrawRequest(GC gc)" doesn't take in account the specified region length, instead passing '1' to subsequent methods. So, even though the pair length is get as a variable: "int length= fPairPosition.getLength();" it isn't passed to 'draw' function. So, instead of calling: if (ICharacterPairMatcher.RIGHT == fAnchor) draw(gc, offset, 1); else draw(gc, offset + length -1, 1); this should be: if (ICharacterPairMatcher.RIGHT == fAnchor) draw(gc, offset, length); else draw(gc, offset + length -1, length); Thanks Reproducible: Always Steps to Reproduce: There are no stepts to reproduce.
The region which the matcher returns is the region in which the pairs are found but the The character painter only paints the matching character and since a character has the length 1 only 1 character will be drawn.
Then what's the correspondent class to "match" multiple characters? Since that there's the "length" variable, and it's not used, I presume that there is an alternative.
(In reply to comment #2) > Then what's the correspondent class to "match" multiple characters? > Since that there's the "length" variable, and it's not used, I presume that > there is an alternative. The region is to tell identify the text between the two chars. There's nothing to match multiple ones.