comparison nodejs/examples/simple/test-translate.js @ 1413:b8dfa491ed9d

Use app.refresh() instead of redraw_changed()
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 06 Apr 2011 11:14:15 +0800
parents 3e80b5cf8da2
children
comparison
equal deleted inserted replaced
1412:3e80b5cf8da2 1413:b8dfa491ed9d
11 coord = app.mb_rt.coord_new(coord_parent) 11 coord = app.mb_rt.coord_new(coord_parent)
12 data=mbapp.ldr.load("sample.png"); 12 data=mbapp.ldr.load("sample.png");
13 paint = app.mb_rt.paint_image_new(data); 13 paint = app.mb_rt.paint_image_new(data);
14 img = app.mb_rt.image_new(10,10,50,50); 14 img = app.mb_rt.image_new(10,10,50,50);
15 paint.fill(img); 15 paint.fill(img);
16 coord.opacity = 0.9;
17 coord.add_shape(img); 16 coord.add_shape(img);
18 17
19 var shift = 0; 18 var shift = 0;
20 function translate_handler() { 19 function translate_handler() {
21 coord_parent[2] = shift; 20 coord_parent[2] = shift;
22 app.mb_rt.redraw_changed(); 21 app.refresh();
23 setTimeout(translate_handler, 100); 22 setTimeout(translate_handler, 100);
24 shift = shift + 10; 23 shift = shift + 10;
25 } 24 }
26 25
27 translate_handler(); 26 translate_handler();