Skip to content

Commit 28c0e1f

Browse files
authored
unmapped-view-node: report bbox with logical size, not physical (#2671)
1 parent e910a6f commit 28c0e1f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

plugins/animate/unmapped-view-node.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ namespace wf
1010
class unmapped_view_snapshot_node : public wf::scene::node_t
1111
{
1212
wf::auxilliary_buffer_t snapshot;
13+
wf::dimensions_t snapshot_logical_size;
1314
std::weak_ptr<wf::view_interface_t> _view;
1415

1516
public:
1617
unmapped_view_snapshot_node(wayfire_view view) : node_t(false)
1718
{
1819
view->take_snapshot(snapshot);
20+
snapshot_logical_size = wf::dimensions(view->get_surface_root_node()->get_bounding_box());
1921
_view = view->weak_from_this();
2022
}
2123

@@ -24,7 +26,7 @@ class unmapped_view_snapshot_node : public wf::scene::node_t
2426
if (auto view = _view.lock())
2527
{
2628
auto current_bbox = view->get_surface_root_node()->get_bounding_box();
27-
return wf::construct_box(wf::origin(current_bbox), snapshot.get_size());
29+
return wf::construct_box(wf::origin(current_bbox), snapshot_logical_size);
2830
}
2931

3032
return {0, 0, 0, 0};

src/view/view.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,10 @@ void wf::view_interface_t::take_snapshot(wf::auxilliary_buffer_t& buffer)
9696
auto root_node = get_surface_root_node();
9797
const wf::geometry_t bbox = root_node->get_bounding_box();
9898
float scale = get_output()->handle->scale;
99-
100-
buffer.allocate({int(bbox.width * scale), int(bbox.height * scale)});
99+
buffer.allocate(wf::dimensions(bbox), scale);
101100

102101
wf::render_target_t target{buffer};
103-
target.geometry = root_node->get_bounding_box();
102+
target.geometry = bbox;
104103
target.scale = scale;
105104

106105
std::vector<scene::render_instance_uptr> instances;

0 commit comments

Comments
 (0)