Git Product home page Git Product logo

Comments (8)

brettz9 avatar brettz9 commented on August 15, 2024

Replicated for small as well as large and extra-large...

from svgedit.

klesun avatar klesun commented on August 15, 2024

Note, that "Small" is now the default value, so any time you open the editor, rulers are off. The only icon size that produces correct rulers positioning is "Medium". For anyone looking for a workaround, go to the SVG-Edit -> Editor Options and change "Icon size" from "Small" to "Medium".
image

Also, here is a screenshot of the bug for reference:
https://unpkg.com/[email protected]/editor/svg-editor.html
image

from svgedit.

klesun avatar klesun commented on August 15, 2024

Related issue: Icon bugs on non-medium icon sizes from 2010

I believe all these bugs have been fixed in r1488.

Love resolution comments starting with "I believe ..." =-D

Commit: 9d08f8c (God bless the VCS)

from svgedit.

klesun avatar klesun commented on August 15, 2024

And here is the issue in which resizable icons were introduced: Resizable icons (using SVG icons)

Commits:

  • c546737 - Made editor preferences (language, icon size and background) be saved and re-applied on page load
  • 2a46a5e - Adding SVG icons to svg-editor.html and related scripts, keeping old with -classic suffix
  • 78bd230 - Made SVG-icons toolbar resizing more efficient, added new size option
  • 20d7b92 - Added more SVG icons, added experimental option to change icon size, fixed clone offset on zoom

Looks like most open source developers who understand SVG are eventually consumed by Adobe...

from svgedit.

klesun avatar klesun commented on August 15, 2024

Oh well, I guess I'll just uncomment this in my svgedit-config.es.js:

svgEditor.setConfig({
  iconsize: 'm', // Will default to 's' if the window height is smaller than the minimum height and 'm' otherwise
}

Curiously enough, the comment says that it only defaults to 's' if window height is small. Apparently my 1080p screen is "small"...

from svgedit.

brettz9 avatar brettz9 commented on August 15, 2024

Note that the comment says "If the window height is smaller than the minimum height".

The code which determines this is this following portion of svg-editor.js:

        const tleft = $('#tools_left');

        let minHeight;
        if (tleft.length) {
          minHeight = tleft.offset().top + tleft.outerHeight();
        }

        const size = editor.pref('iconsize');
        editor.setIconSize(size || ($(window).height() < minHeight ? 's' : 'm'));

IIRC, we may have changed (more recently) to a small icon size because medium icons had its own problems.

Would be really nice if we had people adding to our tests for against the nice and shiny Cypress UI + Cypress UI code coverage plugin testing framework, as we could really prevent a lot of the regressions which otherwise inevitably happen, particularly when other developers come on board.

from svgedit.

brettz9 avatar brettz9 commented on August 15, 2024

That comment could probably be better worded though to indicate the minimum height is one based on the toolbar.

Also, it seems the code above may explain the reason we changed to small; that the toolbar was ending up too large for some screens. Let us know if you find some flaws in this.

from svgedit.

jfhenon avatar jfhenon commented on August 15, 2024

V7 has a fixed icon size.

from svgedit.

Related Issues (20)

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.