Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319764 - [painting][printing] MatchingCharacterPainter:handleDrawRequest - Not drawing the specified length of the pair but using '1'
Summary: [painting][printing] MatchingCharacterPainter:handleDrawRequest - Not drawing...
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-13 13:51 EDT by Timotei Dolean CLA
Modified: 2010-07-14 07:55 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timotei Dolean CLA 2010-07-13 13:51:10 EDT
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.
Comment 1 Dani Megert CLA 2010-07-14 02:50:29 EDT
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.
Comment 2 Timotei Dolean CLA 2010-07-14 07:43:56 EDT
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.
Comment 3 Dani Megert CLA 2010-07-14 07:55:01 EDT
(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.