Fix image.scroll
This commit is contained in:
@@ -317,6 +317,14 @@ class Image {
|
||||
destPoint.y = 0; //clamp destination point to 0
|
||||
}
|
||||
|
||||
// TODO: Optimize
|
||||
|
||||
if (sourceImage == this) {
|
||||
|
||||
sourceImage = clone ();
|
||||
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
|
||||
case CANVAS:
|
||||
@@ -801,12 +809,6 @@ class Image {
|
||||
|
||||
case DATA:
|
||||
|
||||
//#if (js && html5)
|
||||
//ImageCanvasUtil.convertToData (this);
|
||||
//#end
|
||||
|
||||
//ImageDataUtil.scroll (this, x, y);
|
||||
|
||||
copyPixels (this, rect, new Vector2 (x, y));
|
||||
|
||||
case FLASH:
|
||||
|
||||
@@ -369,10 +369,12 @@ class ImageCanvasUtil {
|
||||
|
||||
if ((x % image.width == 0) && (y % image.height == 0)) return;
|
||||
|
||||
var copy = image.clone ();
|
||||
|
||||
convertToCanvas (image, true);
|
||||
|
||||
image.buffer.__srcContext.clearRect (x, y, image.width, image.height);
|
||||
image.buffer.__srcContext.drawImage (image.buffer.__srcCanvas, x, y);
|
||||
image.buffer.__srcContext.drawImage (copy.src, x, y);
|
||||
|
||||
image.dirty = true;
|
||||
image.version++;
|
||||
|
||||
Reference in New Issue
Block a user