Skip to content

Commit

Permalink
Render whenever button_x has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredkhan committed Nov 13, 2024
1 parent 37d081b commit 24783ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 0 additions & 3 deletions OZprivate/rawJS/OZTreeModule/src/interactor/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ class TouchInteractor {
} else if (event.targetTouches.length == 1) {
this.clicking = true;
}
// Jog the tree slightly to ensure that node hover-over states update
// NB: Obviously a hack, ideally we'd force this update without - see #155
this.controller.pan(1, 0);
}

touch_move(event) {
Expand Down
7 changes: 7 additions & 0 deletions OZprivate/rawJS/OZTreeModule/src/render/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ let last_yp = null;
let last_ws = null;
let last_btn_data = null;
let last_btn_action = null;
let last_button_x = null;
let last_button_y = null;

//Do not skip refresh when render_id = 60, 120, 180... because we want to refresh page when node details or images get fetched.
let render_id = 0;
Expand Down Expand Up @@ -110,6 +112,11 @@ function need_refresh() {

if (render_id % 60 === 0) return true;
if (tree_state.xp != last_xp || tree_state.yp != last_yp || tree_state.ws != last_ws) return true;
if (tree_state.button_x != last_button_x || tree_state.button_y != last_button_y) {
last_button_x = tree_state.button_x;
last_button_y = tree_state.button_y;
return true;
}
if (!areEqual(global_button_action.action,last_btn_action)) return true
if (!areEqual(global_button_action.data,last_btn_data)) return true;
return false;
Expand Down
2 changes: 2 additions & 0 deletions OZprivate/rawJS/OZTreeModule/src/tree_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class TreeState {
this.url_parsed = false;
this.last_active_at = new Date();
this.last_render_at = new Date();
this.button_x = null;
this.button_y = null;
let self = this;
setTimeout(function() {
self.url_parsed = true;
Expand Down

0 comments on commit 24783ac

Please sign in to comment.