/* * Copyright (c) 2022, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include namespace Web::Painting { void Paintable::handle_mousedown(Badge, Gfx::IntPoint const&, unsigned, unsigned) { } void Paintable::handle_mouseup(Badge, Gfx::IntPoint const&, unsigned, unsigned) { } void Paintable::handle_mousemove(Badge, Gfx::IntPoint const&, unsigned, unsigned) { } bool Paintable::handle_mousewheel(Badge, Gfx::IntPoint const&, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y) { if (auto* containing_block = this->containing_block()) { if (!containing_block->is_scrollable()) return false; auto new_offset = containing_block->scroll_offset(); new_offset.translate_by(wheel_delta_x, wheel_delta_y); // FIXME: This const_cast is gross. // FIXME: Scroll offset shouldn't live in the layout tree. const_cast(containing_block)->set_scroll_offset(new_offset); return true; } return false; } HitTestResult Paintable::hit_test(Gfx::IntPoint const&, HitTestType) const { VERIFY_NOT_REACHED(); } }