Skip to content

Commit

Permalink
vaev-driver: Don't change the paper size based on the scale.
Browse files Browse the repository at this point in the history
Scale is meant to scale the content within the medium, not the medium itself.

TODO: We should add a way to increas pixel density in the image printer, but not using --scale, either --resolution or --density.
  • Loading branch information
sleepy-monax committed Dec 23, 2024
1 parent ec22ccb commit bf6b06f
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/web/vaev-driver/print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@ Vec<Strong<Scene::Page>> print(Markup::Document const &dom, Print::Settings cons
initialStyle.setCustomProp("-vaev-title", {Css::Token::string(Io::format("\"{}\"", dom.title()).unwrap())});
initialStyle.setCustomProp("-vaev-datetime", {Css::Token::string(Io::format("\"{}\"", Sys::now()).unwrap())});

auto scaleMatrix = Math::Trans2f::makeScale(media.resolution.toDppx());

// MARK: Page Content ------------------------------------------------------

Layout::Tree contentTree = {
Expand All @@ -304,16 +302,11 @@ Vec<Strong<Scene::Page>> print(Markup::Document const &dom, Print::Settings cons
};

auto pageSize = pageRect.size().cast<f64>();

auto scaleMatrix = Math::Trans2f::makeScale(media.resolution.toDppx());
auto pageScene = pages.emplaceBack(
// FIXME: it can be that specific pages have different dimensions
makeStrong<Scene::Page>(
Print::PaperStock{
"custom"s,
pageSize.width,
pageSize.height,
},
scaleMatrix
)
makeStrong<Scene::Page>(settings.paper, scaleMatrix)
);

InsetsPx pageMargin = {};
Expand Down

0 comments on commit bf6b06f

Please sign in to comment.