Serenity Operating System
1/*
2 * Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#include "ScopeWidget.h"
8#include "Layer.h"
9
10namespace PixelPaint {
11
12ScopeWidget::~ScopeWidget()
13{
14 if (m_image)
15 m_image->remove_client(*this);
16}
17
18void ScopeWidget::set_image(Image* image)
19{
20 if (m_image == image)
21 return;
22 if (m_image)
23 m_image->remove_client(*this);
24 m_image = image;
25 if (m_image)
26 m_image->add_client(*this);
27
28 image_changed();
29 update();
30}
31
32void ScopeWidget::set_color_at_mouseposition(Color color)
33{
34 if (m_color_at_mouseposition == color)
35 return;
36
37 m_color_at_mouseposition = color;
38 update();
39}
40
41}