Fix withPixel to save and restore the context

This commit is contained in:
Donovan Preston 2014-08-05 14:53:33 -04:00
Родитель 6a289286f3
Коммит d029c03a48
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -967,9 +967,11 @@ MIDP.withTextAnchor = function(g, anchor, x, y, str, cb) {
MIDP.withPixel = function(g, cb) { MIDP.withPixel = function(g, cb) {
var pixel = g.class.getField("pixel", "I").get(g); var pixel = g.class.getField("pixel", "I").get(g);
var style = "#" + ("00000" + pixel.toString(16)).slice(-6); var style = "#" + ("00000" + pixel.toString(16)).slice(-6);
MIDP.Context2D.save();
MIDP.Context2D.fillStyle = style; MIDP.Context2D.fillStyle = style;
MIDP.Context2D.strokeStyle = style; MIDP.Context2D.strokeStyle = style;
cb(); cb();
MIDP.Context2D.restore();
} }
Native["javax/microedition/lcdui/Graphics.render.(Ljavax/microedition/lcdui/Image;III)Z"] = function(ctx, stack) { Native["javax/microedition/lcdui/Graphics.render.(Ljavax/microedition/lcdui/Image;III)Z"] = function(ctx, stack) {