# HG changeset patch # User Thinker K.F. Li # Date 1284993823 -28800 # Node ID 13e0953c3fb3954ddcea2c23c42a8ce15ce35f52 # Parent 0027379c962e413c2ac3f41c67b99442575ad9b3 backup transform matrix when create a new coord diff -r 0027379c962e -r 13e0953c3fb3 nodejs/mbapp.js --- a/nodejs/mbapp.js Mon Sep 20 22:43:43 2010 +0800 +++ b/nodejs/mbapp.js Mon Sep 20 22:43:43 2010 +0800 @@ -5,6 +5,17 @@ var sys = require("sys"); var ldr = mbfly.img_ldr_new("."); +function _decorate_mb_rt(mb_rt) { + mb_rt._mbapp_saved_coord_new = mb_rt.coord_new; + mb_rt.coord_new = function(parent) { + var coord; + + coord = this._mbapp_saved_coord_new(parent); + coord._mbapp_saved_mtx = [coord[0], coord[1], coord[2], + coord[3], coord[4], coord[5]]; + return coord; + }; +} app=function(display, w, h) { var self = this; @@ -18,6 +29,7 @@ h = 480; mb_rt = this.mb_rt = new mbfly.mb_rt(display, w, h); + _decorate_mb_rt(mb_rt); var background = mb_rt.rect_new(0, 0, 720, 480, 0, 0); var paint = mb_rt.paint_color_new(1, 1, 1, 1); paint.fill(background);