git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update terminals list
[nikiroo-utils.git]
/
src
/
jexer
/
tterminal
/
Sixel.java
diff --git
a/src/jexer/tterminal/Sixel.java
b/src/jexer/tterminal/Sixel.java
index 6a10b7a892c2312d4dbdcb3b6473edecbe4a28b8..1921f44e5c83716ba0c75e2634e30617e3582c20 100644
(file)
--- a/
src/jexer/tterminal/Sixel.java
+++ b/
src/jexer/tterminal/Sixel.java
@@
-117,6
+117,11
@@
public class Sixel {
*/
private int x = 0;
*/
private int x = 0;
+ /**
+ * The maximum y drawn to. This will set the final image height.
+ */
+ private int y = 0;
+
/**
* The current drawing color.
*/
/**
* The current drawing color.
*/
@@
-152,7
+157,7
@@
public class Sixel {
*/
public BufferedImage getImage() {
if ((width > 0) && (height > 0)) {
*/
public BufferedImage getImage() {
if ((width > 0) && (height > 0)) {
- return image.getSubimage(0, 0, width,
height + 6
);
+ return image.getSubimage(0, 0, width,
y + 1
);
}
return null;
}
}
return null;
}
@@
-282,21
+287,27
@@
public class Sixel {
for (int i = 0; i < rep; i++) {
if ((n & 0x01) != 0) {
image.setRGB(x, height + 0, rgb);
for (int i = 0; i < rep; i++) {
if ((n & 0x01) != 0) {
image.setRGB(x, height + 0, rgb);
+ y = Math.max(y, height);
}
if ((n & 0x02) != 0) {
image.setRGB(x, height + 1, rgb);
}
if ((n & 0x02) != 0) {
image.setRGB(x, height + 1, rgb);
+ y = Math.max(y, height + 1);
}
if ((n & 0x04) != 0) {
image.setRGB(x, height + 2, rgb);
}
if ((n & 0x04) != 0) {
image.setRGB(x, height + 2, rgb);
+ y = Math.max(y, height + 2);
}
if ((n & 0x08) != 0) {
image.setRGB(x, height + 3, rgb);
}
if ((n & 0x08) != 0) {
image.setRGB(x, height + 3, rgb);
+ y = Math.max(y, height + 3);
}
if ((n & 0x10) != 0) {
image.setRGB(x, height + 4, rgb);
}
if ((n & 0x10) != 0) {
image.setRGB(x, height + 4, rgb);
+ y = Math.max(y, height + 4);
}
if ((n & 0x20) != 0) {
image.setRGB(x, height + 5, rgb);
}
if ((n & 0x20) != 0) {
image.setRGB(x, height + 5, rgb);
+ y = Math.max(y, height + 5);
}
x++;
if (x > width) {
}
x++;
if (x > width) {