mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
Magnifier: Add 8x magnification and pausing
This adds an option for even more magnification, when you really need to count pixels, as well as pausing the capture by pressing Space and switching between magnification levels with keys 2, 4 & 8.
This commit is contained in:
parent
6bdd62b51b
commit
401ea85655
3 changed files with 23 additions and 3 deletions
|
@ -22,13 +22,16 @@ MagnifierWidget::~MagnifierWidget()
|
|||
|
||||
void MagnifierWidget::set_scale_factor(int scale_factor)
|
||||
{
|
||||
VERIFY(scale_factor == 2 || scale_factor == 4);
|
||||
VERIFY(scale_factor == 2 || scale_factor == 4 || scale_factor == 8);
|
||||
m_scale_factor = scale_factor;
|
||||
update();
|
||||
}
|
||||
|
||||
void MagnifierWidget::sync()
|
||||
{
|
||||
if (m_pause_capture)
|
||||
return;
|
||||
|
||||
auto size = frame_inner_rect().size();
|
||||
Gfx::IntSize grab_size { size.width() / m_scale_factor, size.height() / m_scale_factor };
|
||||
m_grabbed_bitmap = GUI::WindowServerConnection::the().get_screen_bitmap_around_cursor(grab_size).bitmap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue