Git Product home page Git Product logo

Comments (4)

MarcinZiabek avatar MarcinZiabek commented on May 23, 2024

Hairlines 😄

This looks like a bug on the ScottPlot end (though it is an amazing library!). I would suggest clearing the space with just:

canvas.Clear(SKColors.Transparent);

However, this workaround works as expected:

.SkiaSharpCanvas((canvas, size) => {
    canvas.ClipRect(new SKRect(1, 1, size.Width - 1, size.Height - 1)); // here
    canvas.Clear();
    canvas.Clear(SKColors.White);
});

from questpdf.

sproott avatar sproott commented on May 23, 2024

Hairlines 😄

This looks like a bug on the ScottPlot end (though it is an amazing library!). I would suggest clearing the space with just:

canvas.Clear(SKColors.Transparent);

However, this workaround works as expected:

.SkiaSharpCanvas((canvas, size) => {
    canvas.ClipRect(new SKRect(1, 1, size.Width - 1, size.Height - 1)); // here
    canvas.Clear();
    canvas.Clear(SKColors.White);
});

Thank you for the quick reply!

Unfortunately, your suggested change results in the following SVG and does not work either:

<?xml version="1.0" encoding="utf-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="536" height="357">
	<clipPath id="cl_8">
		<rect x="1" y="1" width="533.40002" height="354.93335"/>
	</clipPath>
	<g clip-path="url(#cl_8)">
		<rect width="536" height="357"/>
		<rect fill="white" width="536" height="357"/>
	</g>
</svg>

Any clues on where the issue lies?

EDIT:
Pardon me for my very limited SVG knowledge. I originally thought the rectangles were being drawn separately from the clip path, but upon looking into it more, it seems that the g element references the correct clip path and it should theoretically work. Still, I see the frame in the resulting PDF.

from questpdf.

sproott avatar sproott commented on May 23, 2024

It really looks like a ScottPlot problem. I've managed to spot the hairlines viewing the SVG with InkScape's inkview, too. Therefore it seems like it's not a QuestPDF bug and I'll try to discuss this further at ScottPlot's GitHub.

from questpdf.

MarcinZiabek avatar MarcinZiabek commented on May 23, 2024

It really looks like a ScottPlot problem.

I wouldn't say it's ScottPlot problem per se. It is very close to how Skia converts drawing instructions to SVG content. Then, about how is that content rendered in non-native resolutions (where points do not match integer pixels). I needed to try hard to see this issue on my 4k screen.

But taking into account that ScottPlot officially supports SVG, they can make this small improvement.

from questpdf.

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.