MCPcopy Create free account
hub / github.com/WinDurango/WinDurango / OnPointerPressed

Method OnPointerPressed

projects/WinDurango.Testing/App.cpp:65–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 }
64
65 void OnPointerPressed(IInspectable const &, PointerEventArgs const &args)
66 {
67 float2 const point = args.CurrentPoint().Position();
68
69 for (Visual visual : m_visuals)
70 {
71 float3 const offset = visual.Offset();
72 float2 const size = visual.Size();
73
74 if (point.x >= offset.x && point.x < offset.x + size.x && point.y >= offset.y &&
75 point.y < offset.y + size.y)
76 {
77 m_selected = visual;
78 m_offset.x = offset.x - point.x;
79 m_offset.y = offset.y - point.y;
80 }
81 }
82
83 if (m_selected)
84 {
85 m_visuals.Remove(m_selected);
86 m_visuals.InsertAtTop(m_selected);
87 }
88 else
89 {
90 AddVisual(point);
91 }
92 if (runFirst)
93 {
94 Package pkg = Package::Current();
95 hstring id = pkg.Id().FamilyName();
96 std::wcout << L"Name: " << id.c_str() << L"\n";
97 wd::impl::winrt::interfaces::storage::WinRTDirectory dir("");
98 dir.open();
99 auto wddir = dir.CreateFolder("WinDurango");
100 wddir->open();
101 auto wdlog = wddir->CreateFile("log.txt");
102 wdlog->open();
103 (*wdlog) << std::string("Testing");
104 logthing = wd::common::Logging(wdlog);
105 logthing.Initialize();
106 logthing.Log("WinDurango.Testing", "Hi");
107 logthing.Warn("WinDurango.Testing", "Bye");
108 logthing.Error("WinDurango.Testing", "Oops");
109 runFirst = false;
110 }
111 logthing.Log("WinDurango.Testing", "Click");
112 }
113
114 void OnPointerMoved(IInspectable const &, PointerEventArgs const &args)
115 {

Callers

nothing calls this directly

Calls 9

LoggingFunction · 0.85
RemoveMethod · 0.80
FamilyNameMethod · 0.80
c_strMethod · 0.80
CreateFileMethod · 0.80
SizeMethod · 0.45
IdMethod · 0.45
openMethod · 0.45
InitializeMethod · 0.45

Tested by

no test coverage detected