stabilize Y position of cnc pop op
This commit is contained in:
parent
f332fbece8
commit
bc7f8d64be
1 changed files with 6 additions and 4 deletions
|
|
@ -554,12 +554,14 @@ CAM.init = function(kiri, api) {
|
|||
poprec.use(rec);
|
||||
hoveredOp = el;
|
||||
if (!clock) {
|
||||
const { innerHeight } = window;
|
||||
const { pageY } = ev;
|
||||
const PY = (pageY / innerHeight) * 90;
|
||||
poprec.div.style.transform = `translateY(${-PY}%)`;
|
||||
el.appendChild(poprec.div);
|
||||
poprec.addNote();
|
||||
const { innerHeight } = window;
|
||||
const brect = ev.target.getBoundingClientRect();
|
||||
const prect = poprec.div.getBoundingClientRect();
|
||||
const pcty = (brect.top / innerHeight) * 0.9;
|
||||
const offpx = -pcty * prect.height;
|
||||
poprec.div.style.transform = `translateY(${offpx}px)`;
|
||||
}
|
||||
// option click event appears latent
|
||||
// and overides the sticky settings
|
||||
|
|
|
|||
Loading…
Reference in a new issue