Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG displaying problem with Firefox (after last udpate) #215

Closed
grichka49 opened this issue May 18, 2023 · 5 comments · Fixed by #223
Closed

SVG displaying problem with Firefox (after last udpate) #215

grichka49 opened this issue May 18, 2023 · 5 comments · Fixed by #223
Assignees
Labels
browser/firefox Firefox specific bug/confirmed Confirmed bug bug Something isn't working tool/usersvg About the user supplied/defined svg tool

Comments

@grichka49
Copy link

Bug report notice

SVG are cropped in Firefox. It seems to be OK with Chrome
Animation (animated SVG) are not smooth. I seems to be OK with Chrome

  • [X ] Yes, I'm sure that it is not a configuration mistake

Swiss Army Knife version

The problem appears with last update v2.4.4
All was functional before update.

Bug description

Some part of SVG are not displayed

To Reproduce

Display the card with Firefox browser

Screenshots

Firefox
image

Chrome
image

Desktop browser (please complete the following information):

  • OS: Windows 11
  • Firefox 113.0.1
@grichka49 grichka49 added the bug Something isn't working label May 18, 2023
@AmoebeLabs
Copy link
Owner

AmoebeLabs commented May 18, 2023

Nice energy dashboard!

Try disabling SVG injection:

  options:
    svginjection: false     # true (default) for injection,
                            # false for keeping the external file

see: https://swiss-army-knife-card-manual.amoebelabs.com/tools/usersvg-tool/#styling-injected-vs-external-svgs

I will check firefox to see if I can find the problem FF has with injected SVGs.

@AmoebeLabs AmoebeLabs added the tool/usersvg About the user supplied/defined svg tool label May 18, 2023
@jwaz73
Copy link

jwaz73 commented May 18, 2023

I'm having the same issue with FF (v113.0.1) on Windows 11. No issues with Chrome or Edge.

Where does the codeblock for disabling svgingection go? I tried it here with no change:

      - type: usersvg
      ...
        styles:
          usersvg:
            options:
              svginjection: false

@AmoebeLabs
Copy link
Owner

I'm having the same issue with FF (v113.0.1) on Windows 11. No issues with Chrome or Edge.

Where does the codeblock for disabling svgingection go? I tried it here with no change:

      - type: usersvg
      ...
        styles:
          usersvg:
            options:
              svginjection: false

On the same level as the styles.
So:

  - type:
    options:
      svginjection: false
    styles:

@AmoebeLabs
Copy link
Owner

AmoebeLabs commented May 19, 2023

Yup, FF does weird things with some of the SVGs:

  • The first row shows a perfect AQI face. no clipping at all. I see that with more SVGs
  • The first row shows clipping for some reason for the pollen SVGs. The SVGs don't have any clipping/masking region defined
  • The second row shows NO clipping, other than the clipping/masking specified in the SAK card.

I must do more testing to find out what the problem is with FF when injecting SVGs. I have checked the CSS property overflow = visible, but that one is already defined as Safari needed that setting.

image

According to the inspector, FF does calculate the space for the SVG as it should:

image

The size of the actual SVG is also right:

image

This you can see from this image. They are identical:

image

So FF knows the exact - right - size of the SVG, but is clipping the image in some situations!

@AmoebeLabs AmoebeLabs added browser/firefox Firefox specific bug/confirmed Confirmed bug labels May 19, 2023
@AmoebeLabs
Copy link
Owner

FF seems to have a large history of clipping and masking problems if I browse the internet. That helped in understanding why Safari and Chromium (Chrome / Edge) render as expected, and FF not.

So, after some hours of experimenting and adapting the UserSVG tool, it works now in FF:

  • first card is without any clipping/masking specified, but uses injected SVG's
  • second card is using clipping/masking. AQI is an image, Tres and Grass are injected SVGs with some styling (Tres with a color invert filter, and Grass with opacity set to 0.5), and Weed is an external SVG (not injected).

image

@AmoebeLabs AmoebeLabs self-assigned this May 21, 2023
@AmoebeLabs AmoebeLabs added this to the Release v2.4.5 milestone May 21, 2023
@AmoebeLabs AmoebeLabs linked a pull request May 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser/firefox Firefox specific bug/confirmed Confirmed bug bug Something isn't working tool/usersvg About the user supplied/defined svg tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants