mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
BookElement rendering (in progress)
This commit is contained in:
parent
1c23997bf9
commit
7ac8221a7b
2 changed files with 14 additions and 0 deletions
|
@ -19,5 +19,10 @@
|
||||||
|
|
||||||
package org.geometerplus.zlibrary.text.view;
|
package org.geometerplus.zlibrary.text.view;
|
||||||
|
|
||||||
|
import org.geometerplus.zlibrary.core.image.ZLImageData;
|
||||||
|
|
||||||
public final class BookElement extends ZLTextElement {
|
public final class BookElement extends ZLTextElement {
|
||||||
|
public ZLImageData getImageData() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,8 @@ import java.util.*;
|
||||||
|
|
||||||
import org.geometerplus.zlibrary.core.application.ZLApplication;
|
import org.geometerplus.zlibrary.core.application.ZLApplication;
|
||||||
import org.geometerplus.zlibrary.core.filesystem.ZLFile;
|
import org.geometerplus.zlibrary.core.filesystem.ZLFile;
|
||||||
|
import org.geometerplus.zlibrary.core.image.ZLImageData;
|
||||||
|
import org.geometerplus.zlibrary.core.library.ZLibrary;
|
||||||
import org.geometerplus.zlibrary.core.util.RationalNumber;
|
import org.geometerplus.zlibrary.core.util.RationalNumber;
|
||||||
import org.geometerplus.zlibrary.core.util.ZLColor;
|
import org.geometerplus.zlibrary.core.util.ZLColor;
|
||||||
import org.geometerplus.zlibrary.core.view.ZLPaintContext;
|
import org.geometerplus.zlibrary.core.view.ZLPaintContext;
|
||||||
|
@ -939,6 +941,13 @@ public abstract class ZLTextView extends ZLTextViewBase {
|
||||||
final int c = yStart + (yEnd - yStart) / 2;
|
final int c = yStart + (yEnd - yStart) / 2;
|
||||||
context.setFillColor(new ZLColor(196, 196, 196));
|
context.setFillColor(new ZLColor(196, 196, 196));
|
||||||
context.fillPolygon(new int[] { l, l, r }, new int[] { t, b, c });
|
context.fillPolygon(new int[] { l, l, r }, new int[] { t, b, c });
|
||||||
|
} else if (element instanceof BookElement) {
|
||||||
|
final int vMargin = ZLibrary.Instance().getDisplayDPI() / 15;
|
||||||
|
final int hMargin = ZLibrary.Instance().getDisplayDPI() / 10;
|
||||||
|
final ZLImageData imageData = ((BookElement)element).getImageData();
|
||||||
|
if (imageData != null) {
|
||||||
|
} else {
|
||||||
|
}
|
||||||
} else if (element == ZLTextElement.HSpace) {
|
} else if (element == ZLTextElement.HSpace) {
|
||||||
final int cw = context.getSpaceWidth();
|
final int cw = context.getSpaceWidth();
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue