1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:48:13 +00:00

WindowServer: Place drag and drop overlay at the cursor position

... instead of in the center of the cursor bitmap.

It doesn't make much of a difference, as the default cursor hotspot is
center. But since now we switch between a normal Drag cursor and
DragCopy one that has set hotspot, this caused the overlay to shake.
This commit is contained in:
Karol Kosek 2022-08-29 11:13:29 +02:00 committed by Sam Atkins
parent d4aff36875
commit f1aa03b779

View file

@ -292,7 +292,7 @@ void DndOverlay::update_rect()
auto& font = this->font();
int width = font.width(m_text) + bitmap_width;
int height = max((int)font.glyph_height(), bitmap_height);
auto location = Compositor::the().current_cursor_rect().center().translated(8, 8);
auto location = ScreenInput::the().cursor_location().translated(8, 8);
set_rect(Gfx::IntRect(location, { width, height }).inflated(16, 8));
}