mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 482703 - less setAttribute()ing(speed up panning)
This commit is contained in:
parent
3dee8b150d
commit
decd66cf1a
@ -1293,9 +1293,20 @@ WidgetStack.prototype = {
|
||||
// presumably the caller is managing those directly for now.
|
||||
if (state.frozen)
|
||||
return;
|
||||
|
||||
state.widget.setAttribute("left", state.rect.x + state.offsetLeft);
|
||||
state.widget.setAttribute("top", state.rect.y + state.offsetTop);
|
||||
let w = state.widget;
|
||||
let l = state.rect.x + state.offsetLeft;
|
||||
let t = state.rect.y + state.offsetTop;
|
||||
|
||||
//cache left/top to avoid calling setAttribute unnessesarily
|
||||
if (state._left != l) {
|
||||
state._left = l;
|
||||
w.setAttribute("left", l);
|
||||
}
|
||||
|
||||
if (state._top != t) {
|
||||
state._top = t;
|
||||
w.setAttribute("top", t);
|
||||
}
|
||||
},
|
||||
|
||||
// constrain translate of rect by dx dy to bounds; return dx dy that can
|
||||
|
Loading…
Reference in New Issue
Block a user