var progress = function(n, d) {
$innerbar.width = $bar.width * n / d + 1;
$text.text = "downloaded " + (xwt.math.ceil(100 * n/d)) + "%";
- xwt.yield();
}
xwt.thread = function() {
var new_xwt = xwt.clone(new_rr);
xwt.thread = function() {
+for(var i=0; 100>i; i++) { progress(i, 100); xwt.sleep(100); }
xwt.yield();
new_xwt.apply(xwt.box, new_xwt["main.xwt"]);
thisbox = null;
}
<box height="236" align="bottomleft" packed="false" x="20" y="0">
- <box textcolor="white" id="text" shrink="true" fill="green"/>
+ <box textcolor="white" id="text" shrink="true"/>
</box>
<box packed="false" id="bar" x="20" y="236" width="354" height="20" align="left">
<box id="innerbar" fill="blue" width="10"/>
char* current_pixel = (xi->data + y * xi->bytes_per_line) +
(shared_pixmap ? cx1 * (xi->bits_per_pixel / 8) : - 1 * cy1 * xi->bytes_per_line);
- for(int x=cx1; x < cx1; x++, current_pixel += xi->bits_per_pixel / 8) {
+ for(int x=cx1; x < cx2; x++, current_pixel += xi->bits_per_pixel / 8) {
int source_x = x - dx;
int source_y = y - dy;
+ // FEATURE: be smarter here; can we do something better for the alphaonly case?
int sourcepixel = sourcedata[source_x + source_y * source->getWidth()];
int alpha = (sourcepixel & 0xFF000000) >> 24;
-
- // FEATURE: be smarter here; can we do something better for the alphaonly case?
if (alphaOnly) sourcepixel = rgb;
int source_red = (sourcepixel & 0x00FF0000) >> 16;
int source_green = (sourcepixel & 0x0000FF00) >> 8;