Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Self Referring snap to whole pixels

  • Self Referring snap to whole pixels

    Posted by Navarro Parker on March 7, 2016 at 7:54 pm

    I’ve been using this old chestnut to keep vector layers crisp:

    newX = Math.round(transform.position[0]);
    newY = Math.round(transform.position[1]);
    [newX, newY]

    Is there a simpler (and easier to remember) way to write this? In the position parameter, something like…

    Math.round(value)
    or
    transform.position.toFixed(0)

    Neither of these work, of course.

    Dan Ebberts replied 10 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    March 7, 2016 at 8:18 pm

    I don’t know if this is any better:

    [Math.round(value[0]),Math.round(value[1])]

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy