verge icon indicating copy to clipboard operation
verge copied to clipboard

inViewport, inX, inY expressiveness

Open ryanve opened this issue 7 years ago • 2 comments

In 1.x the signature for these is .inViewport(element, cushion=0) where cushion is an optional +/- cushion around the element. Is this clear enough or should we somehow redesign to be more expressive?

ryanve avatar Mar 15 '17 21:03 ryanve

Right and bottom cushion doesn't work for negative values.

https://github.com/ryanve/verge/blob/master/verge.js#L86-L87 If I set cushion -100, verge won't mark nodes as visible starting from 0 to 100 of the window height, but it also won't mark nodes as visible starting from (window height - 100), because 200 + -100 (200 is an example offset) equals to 100, not 300. - cushion should be replaced with (- Math.abs(cushion).

drgullin avatar Sep 25 '17 05:09 drgullin

Sorry, that solution won't work, this needs some other fix.

drgullin avatar Sep 25 '17 06:09 drgullin