flekschas/piling.js

Decouple pile border size from pile scale

flekschas opened this issue · 0 comments

Commit or branch: master

Observed behavior

  • The border is part of the pile graphics and if the pile gets scaled up the border is scaled too. Naturally, the border size is also scaled.

Expected behavior

  • The border size should be scale invariant. I.e., when a pile gets scaled up by 2x the border size should still be 1px (or whatever the user has set).

Why?

  • Upon scaling a pile the border gets unnecessary large. This also conflicts prevents us from haven an effective scale and border-size encoding at the moment.

This won't be too straight forward to implement. My current idea is to have the following scene graph:

- rootGraphics
\-> borderGraphics
\-> contentGraphics
    \-> previewContainer
    \-> itemContainer

And when we scale up we actually only scale up the contentGraphics, calculate it's bounds, and then update borderGraphics with the new bounds.