c0bra / deviceframe

:iphone: Put device frames around your mobile/web/progressive app screenshots.
Other
580 stars 16 forks source link

Fix iPhone X frame #15

Closed jacobp100 closed 6 years ago

jacobp100 commented 6 years ago

Rather than drawing orthogonal lines from the centre to measure the screen size, this uses a flood fill algorithm, and measures the size of the resulting shape.

Please note I'm maintaining a fork of this project on my account, as I need the output in a different format

c0bra commented 6 years ago

@jacobp100 Good stuff! I'm checking it out and it seems to work pretty well.

One thing I noticed is that the parse-frames.js function is significantly slower (which makes sense), however I can get a ~50% speedup by using the cluster module:

image

I'll work on opening a PR for that after I get yours fully tested and merged.

c0bra commented 6 years ago

Actually looks like part of it was either just load on my machine or I was potentially running under node 6. Node 8 looks like this:

image

Much better!

jacobp100 commented 6 years ago

That's huge! Looks like the improvements in node are really showing off!