SVG pixel ratio is 1:2 from code to rendering

Jason

When rendering my SVG the x, y, width and height are doubling in pixels. What is causing this?

EDIT:

Monitor is 3840 X 2160 with 200% scale in windows

<!DOCTYPE html>
<html>
<head>
    <style>
        #svg {
            border-style: solid;
        }
    </style>
</head>
<body>
    <svg id="svg" width="300px" height="200px">
        <image x="20" y="20" width="100px" height="100px" xlink:href="test_image.png"></image>
    </svg>
</body>
</html>

enter image description here

Jason

Windows scaling was set to 200% with a 3840 X 2160 monitor causing the SVG pixel ratio to be 1:2 from code to rendering.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

what exactly is device pixel ratio?

Preserve aspect ratio for SVG Text

How to get 1 pixel width borders in UICollectionView cells? (code provided)

Understanding responsive images and device pixel ratio

Rendering code in Angular 2 template

Sub-pixel rendering

Rendering a component partial from code in OctoberCMS

Font-size and device-pixel-ratio

How to prevent half-pixel SVG shift on high pixel ratio devices (Retina)?

Creating an HBITMAP from pixel buffer then rendering

ImageMagick: Determining Pixel Aspect Ratio

How to display only 1 pixel from loaded image and tile it

Dynamically created svg paths from geojsons are not rendering to a ref

How can I convert the width of SVG from percent to pixel?

Static svg file not rendering from spark-java

Manual SVG text rendering using svg.js + glyphs pulled from SVG font

Finding a unique value from 2 columns and then a ratio of those values

How to calculate device pixel ratio

Invalid pixel aspect ratio in ffmpeg

Why display:table subtract 1 pixel from an image?

Filter Rectangles with 2:1 Aspect Ratio from an array of rectangles

merge 2 data frames by 1:2 column ratio

How to expand to Labels having height in ratio 2:1?

Texture mapping results in solid color of 1 pixel from texture

2 column layout with 1 aspect ratio container and a full height div

How to check if an image has 2 bytes per pixel and how to convert it to an image with 1 byte per pixel?

calculate the pixel ratio of two halves of an image

Shopify Pixel Extension - exit code 1

Device pixel ratio without the BuildContext