forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayer.cpp
More file actions
41 lines (31 loc) · 719 Bytes
/
layer.cpp
File metadata and controls
41 lines (31 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Aseprite UI Library
// Copyright (C) 2018-2024 Igara Studio S.A.
// Copyright (C) 2001-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ui/layer.h"
#include "os/surface.h"
namespace ui {
void UILayer::reset()
{
m_surface.reset();
}
void UILayer::setSurface(const os::SurfaceRef& newSurface)
{
m_surface = newSurface;
}
void UILayer::setPosition(const gfx::Point& pos)
{
m_pos = pos;
}
gfx::Rect UILayer::bounds() const
{
if (!m_surface)
return gfx::Rect();
return gfx::Rect(m_pos.x, m_pos.y, m_surface->width(), m_surface->height());
}
} // namespace ui