forked from UnigramDev/Unigram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChatBackgroundPattern.cpp
More file actions
52 lines (42 loc) · 1.22 KB
/
Copy pathChatBackgroundPattern.cpp
File metadata and controls
52 lines (42 loc) · 1.22 KB
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
42
43
44
45
46
47
48
49
50
51
52
#include "pch.h"
#include "ChatBackgroundPattern.h"
#if __has_include("ChatBackgroundPattern.g.cpp")
#include "ChatBackgroundPattern.g.cpp"
#endif
#include <winrt/Windows.UI.Xaml.Media.h>
using namespace winrt::Windows::UI::Xaml::Media;
namespace winrt::Telegram::Native::implementation
{
ICompositionSurface ChatBackgroundPattern::Surface()
{
return m_surface;
}
float2 ChatBackgroundPattern::RenderSize()
{
if (auto loadedImageSurface = m_surface.try_as<LoadedImageSurface>())
{
return loadedImageSurface.DecodedSize();
}
return m_renderSize;
}
float2 ChatBackgroundPattern::RenderPhysicalSize()
{
if (auto loadedImageSurface = m_surface.try_as<LoadedImageSurface>())
{
return loadedImageSurface.DecodedPhysicalSize();
}
return m_renderPhysicalSize;
}
float2 ChatBackgroundPattern::NaturalSize()
{
if (auto loadedImageSurface = m_surface.try_as<LoadedImageSurface>())
{
return loadedImageSurface.NaturalSize();
}
return m_naturalSize;
}
IVector<ChatBackgroundSymbol> ChatBackgroundPattern::Symbols()
{
return m_symbols;
}
}