serenity/Userland/Applications/PixelPaint/Selection.h
Andreas Kling 1b897ec561 PixelPaint: Add a Selection class (ImageEditor has a Selection)
This will represent a complex, region-based selection in the future.
For now though, it's just a simple rectangle. :^)
2021-06-14 18:25:17 +02:00

30 lines
519 B
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibGfx/Rect.h>
namespace PixelPaint {
class ImageEditor;
// Coordinates are image-relative.
class Selection {
public:
Selection() { }
bool is_empty() const { return m_rect.is_empty(); }
void clear() { m_rect = {}; }
void set(Gfx::IntRect const& rect) { m_rect = rect; }
void paint(Gfx::Painter&, ImageEditor const&);
private:
Gfx::IntRect m_rect;
};
}