Giter Site home page Giter Site logo

Comments (12)

CoDEmanX avatar CoDEmanX commented on June 9, 2024 1

Ah, makes sense. The problem is, that there is no stroke or polygon outside the canvas. There are values greater than 24, but they are used in an elliptical arch curve command, which may specify coordinates outside the canvas, but based on the other parameters it doesn't mean that any point or area lies outside the canvas in the end.

Could you change the logic to render the SVG and test if any pixels are outside the 24x24 canvas? That should make it safer. Or add an option so that the user can specify the correct scaling manually?

from mdi-sandbox.

PeterShaggyNoble avatar PeterShaggyNoble commented on June 9, 2024 1

@MrGrigri, not yet; it automatically picks up whether it's an existing icon, a Google icon or a custom icon and applies the appropriate label and colour.

Turns out the fix for the issue, though, is a lot simpler than I thought - I already have it set up to check which JSON file, if any, the pasted path data is in and apply the necessary transform so I just need to remove the checks on the points when the data isn't found in any of the files. Should get a chance to do that before (work)day's end.

from mdi-sandbox.

CoDEmanX avatar CoDEmanX commented on June 9, 2024

from mdi-sandbox.

MrGrigri avatar MrGrigri commented on June 9, 2024

No transforms. just a single path element with an SVG ViewBox of 0 0 24 24.

comb.zip

from mdi-sandbox.

CoDEmanX avatar CoDEmanX commented on June 9, 2024

from mdi-sandbox.

MrGrigri avatar MrGrigri commented on June 9, 2024

Yeah, I use two 1920x1080 displays.

from mdi-sandbox.

PeterShaggyNoble avatar PeterShaggyNoble commented on June 9, 2024

There are some transforms used to account for the fact that the path data for the extended icons, for example, exceeds 24*24 as that data was generated by simply converting the WOFF2 files to SVG.

In order to choose which transform to apply (as the stock icons and the AOG icons are different sizes), the position of the right-most or bottom-most (whichever is higher) point in the path data is used and if it's greater than 24 then a transform is selected and applied.

In the case of this particular icon, it has point data at 28.69 causing the transforms to kick in.

from mdi-sandbox.

PeterShaggyNoble avatar PeterShaggyNoble commented on June 9, 2024

Ah, yes, those would cause problems.

The solution, I think, would be to check the path data entered against the JSON files for Google's icons and only apply the transforms if a match is found as, outside of those icons, all path data entered into the preview generator should be for a 24*24 icon, whether it be one of our existing icons or a new icon someone's trying to create a preview for.

I've added it to the top of my to-do list so it gets done next. I'm currently working on (finally!) displaying icon meta info - contributor name, version added/updated/renamed/removed - on the site.

from mdi-sandbox.

PeterShaggyNoble avatar PeterShaggyNoble commented on June 9, 2024

By the way, in the meantime, you can use the automated preview generator instead as it doesn't apply any transforms to custom path data.

Example:

http://mdi.houseofdesign.ie/tools/preview/?name=comb&action=download&path=M19.13,6.56c-.11,1.74-1.86,3.65-3.9,5.86a28.69,28.69,0,0,0-5.12,6.81C9,21.69,7.54,22,6.9,22H6.8A2,2,0,0,1,5,20.63a3.16,3.16,0,0,1,1.2-3.34C8.37,15.37,9.93,14,10,13.17a.56.56,0,0,0-.14-.38,7.48,7.48,0,0,1-2.25-2.68.34.34,0,0,1,.16-.4.37.37,0,0,1,.45.09,5.16,5.16,0,0,0,1.85,1.51.47.47,0,0,0,.38-.12.61.61,0,0,0,.14-.26c-.13-.13-.56-.52-2.05-1.77a.52.52,0,0,1-.07-.71l.06-.09a.55.55,0,0,1,.35-.2.6.6,0,0,1,.39.11l2,1.6c.05,0,.11.06.14,0a.4.4,0,0,0,.24-.29.21.21,0,0,0-.06-.08L9.5,7.86a.53.53,0,0,1-.1-.71h0a.51.51,0,0,1,.35-.22.56.56,0,0,1,.4.1l2,1.61.06,0a.67.67,0,0,0,.25-.33.18.18,0,0,0-.08-.15l-2-1.58a.49.49,0,0,1-.09-.68.48.48,0,0,1,.33-.2.51.51,0,0,1,.38.1l2.06,1.62,0,0a.42.42,0,0,0,.24-.26.14.14,0,0,0-.06-.09l-2-1.63a.52.52,0,0,1-.12-.65.51.51,0,0,1,.75-.16L14,6.28a.19.19,0,0,0,.1,0,.3.3,0,0,0,.23-.25.14.14,0,0,0-.07-.1l-2-1.63a.53.53,0,0,1-.1-.71l.09-.13a.53.53,0,0,1,.35-.21.53.53,0,0,1,.4.1L15.05,5a.19.19,0,0,0,.14,0,.62.62,0,0,0,.46-.8c0-.13-.26-.61-2.05-1.54a.38.38,0,0,1-.19-.48A.37.37,0,0,1,13.87,2C14.78,2.3,19.3,3.84,19.13,6.56Z

comb

from mdi-sandbox.

MrGrigri avatar MrGrigri commented on June 9, 2024

Does the URL not support the 'type'? E.g. Rejected, or Work in Progress.

from mdi-sandbox.

PeterShaggyNoble avatar PeterShaggyNoble commented on June 9, 2024

Just pushed the fix, it should be live shortly.

from mdi-sandbox.

PeterShaggyNoble avatar PeterShaggyNoble commented on June 9, 2024

Just pushed the same fix for overlays, which I forgot about.

from mdi-sandbox.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.