mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
PixelPaint: Scale the clone tool sample marker size with zoom level
This commit is contained in:
parent
da0ec8e635
commit
8fa6a85100
1 changed files with 4 additions and 5 deletions
|
@ -176,15 +176,14 @@ Optional<Gfx::IntRect> CloneTool::sample_marker_rect()
|
||||||
if (!m_sample_location.has_value())
|
if (!m_sample_location.has_value())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
auto sample_pos = m_editor->content_to_frame_position(m_sample_location.value());
|
|
||||||
// We don't want the marker to be a single pixel and hide the color.
|
|
||||||
auto offset = AK::max(2, size() / 2);
|
auto offset = AK::max(2, size() / 2);
|
||||||
return Gfx::IntRect {
|
Gfx::IntRect content_rect = {
|
||||||
(int)sample_pos.x() - offset,
|
m_sample_location.value().x() - offset,
|
||||||
(int)sample_pos.y() - offset,
|
m_sample_location.value().y() - offset,
|
||||||
offset * 2,
|
offset * 2,
|
||||||
offset * 2
|
offset * 2
|
||||||
};
|
};
|
||||||
|
return m_editor->content_to_frame_rect(content_rect).to_type<int>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CloneTool::update_sample_marker(Optional<Gfx::IntRect> old_rect)
|
void CloneTool::update_sample_marker(Optional<Gfx::IntRect> old_rect)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue