Jump to content
You must now use your email address to sign in [click for more info] ×

Small line between rectangles


Recommended Posts

Hi everyone,

while working on some simple design with rectangles I noticed this small line in between the rectangles. Why are the rectangles not rendered as one big rectangle?

Further details:

- Stroke is set to "None"

- The rectangles are pixel perfect aligned on top of each other

- The fact that they are visually but not technically separated also appears when exporting to a SVG and making a PNG out of it

 

Greetings,

Lukas

Affinity Designer.png

Link to comment
Share on other sites

  • Staff

Hi Lukas,

Welcome to the forums :)

25 minutes ago, Lukas. said:

and then import the SVG into a normal document (so it will be rendered) there is still said gap between them.

Are you referring to placing the file in another Affinity Designer document? I've opened both your .afdesign and svg file and at 100% zoom level there's no white line shown so I'm a little unsure what you mean by this!

Link to comment
Share on other sites

  • Staff

No problem at all, I've tried following this workflow using your provided file and at 100% zoom level in Affinity Photo I can see a very faint white line, however I exported the file as a JPEG and the line is not visible. I believe this is a rendering choice with embedded documents, but this shouldn't show on export :) 

Link to comment
Share on other sites

Those are my results (attachments). I mean it's not a big problem, I can always make it overlap on purpose to ensure correct representation in the final rendering but I'm still wondering about this anyway.
I looked into the encoding of the SVG:

    <g transform="matrix(0.98824,0,0,1.24687,-326.325,-512.304)">
        <rect x="330.208" y="410.872" width="303.57" height="80.201"/>
    </g>
    <g transform="matrix(0.98824,0,0,1.24687,-326.325,-412.304)">
        <rect x="330.208" y="410.872" width="303.57" height="80.201"/>
    </g>

So I'm guessing the Matrix-Transform is not accurate enough on the floating points given in the <rect>. Could that be it?

rectangles.afphoto

rectangles.jpg

Link to comment
Share on other sites

  • Staff

The placed/embedded SVG is scaled (up) on your document so it's not aligned with the pixel grid anymore (thus the background bleeding through the common edge of the rectangles). If you resize/place it with the original document dimensions (which were 300x200 or multiples of that value) and with integer X,Y coordinates it should display/render without that gap at 100% view and when exporting. For some weird reason when we edit the embedded document sometimes it still displays the line at 100% zoom. It's probably due to the reason you pointed above on SVG export.

Link to comment
Share on other sites

Not sure it's significant, but I opened the .svg file in Firefox, and at 170% or higher zoom there's a white line between the two rectangles.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

21 minutes ago, walt.farrell said:

Not sure it's significant, but I opened the .svg file in Firefox, and at 170% or higher zoom there's a white line between the two rectangles.

No need to zoom in, just inspect and run the SVG code in some online tool ...

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

1 hour ago, Lukas. said:

So I'm guessing the Matrix-Transform is not accurate enough on the floating points given in the <rect>. Could that be it?

Yes, if you add/remove (in this case -413.304) just one pixel value for the second rect in it's transform matrix it should look Ok, aka alter the sixth value of the  transformation matrix there ...

<g transform="matrix(0.98824,0,0,1.24687,-326.325,-413.304)">
        <rect x="330.208" y="410.872" width="303.57" height="80.201"/>
</g>

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

Thanks for everyone's contribution.

So what's the solution now? I guess I'm not gonna manually manipulate the svg-file after I made an export from Affinity Designer? Is there maybe an option for something like "raw export" or do I just make them overlap now as a hacky workaround?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.