mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
fixed NBSPACE processing
This commit is contained in:
parent
2553ca4e9c
commit
e672bf6892
2 changed files with 3 additions and 2 deletions
|
@ -158,6 +158,7 @@ public final class ZLTextParagraphCursor {
|
|||
if (index > 0 && spaceState == NO_SPACE) {
|
||||
addWord(data, offset + wordStart, index - wordStart, myOffset + wordStart, hyperlink);
|
||||
}
|
||||
elements.add(nbSpace);
|
||||
if (spaceState != SPACE) {
|
||||
spaceState = NON_BREAKABLE_SPACE;
|
||||
}
|
||||
|
@ -170,7 +171,6 @@ public final class ZLTextParagraphCursor {
|
|||
wordStart = index;
|
||||
break;
|
||||
case NON_BREAKABLE_SPACE:
|
||||
elements.add(nbSpace);
|
||||
wordStart = index;
|
||||
break;
|
||||
case NO_SPACE:
|
||||
|
|
|
@ -227,7 +227,8 @@ abstract class ZLTextViewBase extends ZLView {
|
|||
}
|
||||
|
||||
final int getElementHeight(ZLTextElement element) {
|
||||
if (element instanceof ZLTextWord ||
|
||||
if (element == ZLTextElement.NBSpace ||
|
||||
element instanceof ZLTextWord ||
|
||||
element instanceof ZLTextFixedHSpaceElement) {
|
||||
return getWordHeight();
|
||||
} else if (element instanceof ZLTextImageElement) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue