diff options
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/core/cross/canvas.cc | 3 | ||||
-rw-r--r-- | o3d/samples/canvas-texturedraw.html | 4 | ||||
-rw-r--r-- | o3d/samples/o3djs/io.js | 6 | ||||
-rw-r--r-- | o3d/samples/o3djs/util.js | 2 |
4 files changed, 9 insertions, 6 deletions
diff --git a/o3d/core/cross/canvas.cc b/o3d/core/cross/canvas.cc index 6040000..7e8f975 100644 --- a/o3d/core/cross/canvas.cc +++ b/o3d/core/cross/canvas.cc @@ -215,10 +215,11 @@ void Canvas::DrawBitmap(Texture2D* texture2d, SaveMatrix(); if (flip_) { Scale(1, -1); + bottom = -bottom; } sk_canvas_.drawBitmap(bitmap, SkFloatToScalar(left), - SkFloatToScalar(-bottom), + SkFloatToScalar(bottom), NULL); RestoreMatrix(); } diff --git a/o3d/samples/canvas-texturedraw.html b/o3d/samples/canvas-texturedraw.html index ce2723f..3b51270 100644 --- a/o3d/samples/canvas-texturedraw.html +++ b/o3d/samples/canvas-texturedraw.html @@ -128,7 +128,7 @@ function drawCursor(e) { g_canvasQuad.canvas.drawBitmap( g_brushTexture, (offset.x / brushScale - g_brushTexture.width * 0.5), - (offset.y / brushScale + g_brushTexture.height * 0.5)); + (offset.y / brushScale - g_brushTexture.height * 0.5)); g_canvasQuad.canvas.restoreMatrix(); g_canvasQuad.updateTexture(); } @@ -151,7 +151,7 @@ function changeBrushTexture() { } g_brushTexture = texture; } - }); + }, false, false); } /** diff --git a/o3d/samples/o3djs/io.js b/o3d/samples/o3djs/io.js index d101373..784e5e0 100644 --- a/o3d/samples/o3djs/io.js +++ b/o3d/samples/o3djs/io.js @@ -633,16 +633,18 @@ o3djs.io.loadBitmaps = function(pack, url, callback, opt_generateMips) { * texture is loaded. It will be passed the texture and an exception on * error or null on success. * @param {boolean} opt_generateMips Generate Mips. Default = true. + * @param {boolean} opt_flip Flip texture. Default = true. * @return {!o3djs.io.LoadInfo} A LoadInfo to track progress. * @see o3djs.io.loadBitmaps * @see o3djs.loader.createLoader */ -o3djs.io.loadTexture = function(pack, url, callback, opt_generateMips) { +o3djs.io.loadTexture = function( + pack, url, callback, opt_generateMips, opt_flip) { function onLoaded(request, rawData, exception) { var texture = null; if (!exception) { texture = o3djs.texture.createTextureFromRawData( - pack, rawData, opt_generateMips); + pack, rawData, opt_generateMips, opt_flip); pack.removeObject(request); } callback(texture, exception); diff --git a/o3d/samples/o3djs/util.js b/o3d/samples/o3djs/util.js index 0cc465e..88f797b 100644 --- a/o3d/samples/o3djs/util.js +++ b/o3d/samples/o3djs/util.js @@ -60,7 +60,7 @@ o3djs.util.PLUGIN_NAME = 'O3D Plugin'; * utility libraries. * @type {string} */ -o3djs.util.REQUIRED_VERSION = '0.1.42.0'; +o3djs.util.REQUIRED_VERSION = '0.1.42.4'; /** * The width an O3D must be to put a failure message inside |