designsystemsinternational / mechanic

Mechanic is a framework to build assets built on web code.
https://mechanic.design
MIT License
253 stars 11 forks source link

[WIP] Add export density to canvas renderer #146

Open lucasdinonolte opened 2 years ago

lucasdinonolte commented 2 years ago
runemadsen commented 2 years ago

I was just thinking about this, and I think this is the right implementation. We should make sure that the getCanvas function throws an error if it doesn't have the needed width and height, whether that comes from inputs, the getCanvas arguments, or both. A nice error message with a call for the user to add the dimensions would be very helpful.

lucasdinonolte commented 2 years ago

I was just thinking about this, and I think this is the right implementation. We should make sure that the getCanvas function throws an error if it doesn't have the needed width and height, whether that comes from inputs, the getCanvas arguments, or both. A nice error message with a call for the user to add the dimensions would be very helpful.

I had the same notion and added some first drafts for error messages. https://github.com/designsystemsinternational/mechanic/pull/146/files#diff-cea56d01b8f19fd6436a19f2b4bbd9d2258c6edbeef3df917df2026fcf1ed520R82 :blush: