Skip to content

Commit

Permalink
untransform_dpi rect before send to pixbuf
Browse files Browse the repository at this point in the history
  • Loading branch information
qPCR4vir committed May 26, 2024
1 parent 37f70e5 commit 043ba2c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/gui/detail/drawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <nana/config.hpp>
#include <nana/gui/detail/bedrock.hpp>
#include <nana/gui/detail/drawer.hpp>
#include "../../detail/platform_abstraction.hpp"

#if defined(NANA_X11)
#include "../../detail/posix/platform_spec.hpp"
Expand Down Expand Up @@ -625,6 +626,11 @@ namespace nana
(good_r.right() > visual.right()) || (good_r.bottom() > visual.bottom()))
{
auto graph = wd->root_graph;

// untransform r and good_r to the System-side dpi before creating a pixel buffer
platform_abstraction::untransform_dpi(r , graph->get_dpi());
platform_abstraction::untransform_dpi(good_r, graph->get_dpi());

nana::paint::pixel_buffer pixbuf(graph->handle(), r);

pixel_argb_t px0, px1, px2, px3;
Expand Down

0 comments on commit 043ba2c

Please sign in to comment.