Skip to content

Commit

Permalink
Try fixing bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Affolter Matias committed May 14, 2024
1 parent bb83db0 commit b3a0ba0
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
3 changes: 1 addition & 2 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,13 @@
};

var _RELOAD = function() {
/*setTimeout(function (){
setTimeout(function (){
try{
location.reload(true);
} catch (x){
location.replace(location.href);
}
}, 777);
*/
};

var _LISTEN_RELOAD = function() {
Expand Down
2 changes: 1 addition & 1 deletion client/chunk_15.min.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,13 @@
};

var _RELOAD = function() {
/*setTimeout(function (){
setTimeout(function (){
try{
location.reload(true);
} catch (x){
location.replace(location.href);
}
}, 777);
*/
};

var _LISTEN_RELOAD = function() {
Expand Down
8 changes: 4 additions & 4 deletions service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ var LOAD_FILES_USEFUL = ["/src/fonts/normative/index.css"].concat(["illusion.jpg
var LOAD_FILES_STATIC = ["sfx/md/hero_decorative-celebration-02", "sfx/md/navigation_selection-complete-celebration", "sfx/md/navigation_transition-left", "sfx/md/state-change_confirm-down", "sfx/md/ui_lock", "sfx/md/ui_unlock", "sfx/md/ui_scan", "sfx/md/alert_high-intensity", "sfx/md/navigation_transition-right", "voice/cn/accessing_memory", "voice/cn/complete", "voice/cn/please_wait", "voice/cn/data_upload", "voice/cn/processing", "voice/cn/enhanced", "voice/cn/rewriting_deep_layer_protocols", "voice/cn/vision_activated", "voice/cn/vision_deactivated", "voice/cn/filtering", "music/redeclipse/track_09"].map(F_SND).concat(["presentation", "tutorial", "create", "enhanced", "pixelated", "upload", "share1", "joke1", "create", "enhanced", "pixelated", "presentation", "presentation2", "sponsors", "tutorial", "upload", "labintro", "share2", "share3", "share4", "share5", "share6", "share7", "joke2", "joke3", "joke4", "joke5", "joke6", "joke7", "joke8", "joke9", "joke10", "joke11"].map(F_VID));

// Cache names
var REQUIRED_CACHE = "unless-update-cache-v1023-required";
var USEFUL_CACHE = "unless-update-cache-v1023-useful";
var STATIC_CACHE = "unless-update-cache-v1023-static";
var OTHER_CACHE = "unless-update-cache-v1023-other";
var REQUIRED_CACHE = "unless-update-cache-v1024-required";
var USEFUL_CACHE = "unless-update-cache-v1024-useful";
var STATIC_CACHE = "unless-update-cache-v1024-static";
var OTHER_CACHE = "unless-update-cache-v1024-other";

// Regular expressions for chunk matching
var MAIN_CHILD_CHUNK_REGEX = /chunk_(main_[a-z0-9]+)\.min\.js$/i;
Expand Down
22 changes: 12 additions & 10 deletions src/js/components/canvaspixels/utils/SuperCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,18 @@ class SuperCanvas {
render() {
"use strict";
const { b, enablePaintType, s } = this.state;
if (enablePaintType === 'bitmap' && b) {
s.canvasContext.globalCompositeOperation = 'copy';
s.canvasContext.drawImage(b.bmp, 0, 0, b.bmp.width, b.bmp.height);
} else if (enablePaintType === 'offscreen') {
s.canvasContext.globalCompositeOperation = 'copy';
s.canvasContext.drawImage(s.offscreenCanvasContext.canvas, 0, 0);
} else {
s.canvasContext.putImageData(new ImageData(this.state.prUint8a, s.width, s.height), 0, 0);
}
return Promise.resolve();
return new Promise(function (resolve){
if (enablePaintType === 'bitmap' && b) {
s.canvasContext.globalCompositeOperation = 'copy';
s.canvasContext.drawImage(b.bmp, 0, 0, b.bmp.width, b.bmp.height);
} else if (enablePaintType === 'offscreen') {
s.canvasContext.globalCompositeOperation = 'copy';
s.canvasContext.drawImage(s.offscreenCanvasContext.canvas, 0, 0);
} else {
s.canvasContext.putImageData(new ImageData(this.state.prUint8a, s.width, s.height), 0, 0);
}
resolve();
});
}

prender() {
Expand Down
9 changes: 5 additions & 4 deletions src/js/components/canvaspixels/utils/SuperMasterMeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,22 +333,23 @@ const SuperMasterMeta = {

meta.super_canvas.check(pxl_width, pxl_height).catch(handle_reject0).then(function () {
"use strict";
meta.super_canvas.prender().then(function () {
meta.super_canvas.prender().finally(function () {
"use strict";
_old_pxls_hovered.clearAndBulkAdd(Uint32Array.of(image_imported_resizer_index, _pxls_hovered));
_current_layer.clear_changes();
_pxl_indexes_of_selection_drawn.setFromSetFixed(_pxl_indexes_of_selection);
_pxl_indexes_of_old_shape.setFromSetFixed(_pxl_indexes_of_current_shape);
_previous_imported_image_pxls_positioned_keyset.setFromSetFixed(imported_image_pxls_positioned_keyset);
_pxl_indexes_of_current_shape.clear();
meta.sraf.run_frame(function () {

meta.sraf.run_frame(() => {
"use strict";
state._old_selection_pair_highlight = _selection_pair_highlight;
state._old_layers_string_id = ""+old_layers_string_id;
state._did_hide_canvas_content = Boolean(hide_canvas_content);
state._old_pxl_width = parseInt(pxl_width);
state._old_pxl_height = parseInt(pxl_height);
state._last_paint_timestamp = +requested_at;
_pxl_indexes_of_current_shape.clear();
_pxl_indexes_of_old_shape.setFromSetFixed(_pxl_indexes_of_current_shape);
return render_binding();
}, false, clear_canvas || is_there_new_dimension || force_update, Date.now(), "render").finally(resolve0);
});
Expand Down

0 comments on commit b3a0ba0

Please sign in to comment.