aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-10-17 15:58:00 +0800
committercrupest <crupest@outlook.com>2020-10-17 15:58:00 +0800
commitbb3d4d561a7c0b0b6cec5561d0a84a1bfc30bf55 (patch)
tree6930ab471e66a61f8a3806e532d69d0ff9c634e8
parent46ff47d2f47a66372ca0a8a09dd08c4fb04004f3 (diff)
parenta1f950e2b3b2268b267e647205b14b59c15f8ee1 (diff)
downloadcru-bb3d4d561a7c0b0b6cec5561d0a84a1bfc30bf55.tar.gz
cru-bb3d4d561a7c0b0b6cec5561d0a84a1bfc30bf55.tar.bz2
cru-bb3d4d561a7c0b0b6cec5561d0a84a1bfc30bf55.zip
Merge branch 'master' of https://github.com/crupest/CruUI into master
-rw-r--r--.gitignore2
-rw-r--r--include/cru/common/Base.hpp3
-rw-r--r--include/cru/platform/Matrix.hpp4
-rw-r--r--src/ui/UiHost.cpp2
-rw-r--r--src/ui/controls/TextControlService.hpp2
5 files changed, 9 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 122fa5e4..3365deda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -591,3 +591,5 @@ flycheck_*.el
compile_flags.txt
.clangd
+.kdev4
+CruUI.kdev4
diff --git a/include/cru/common/Base.hpp b/include/cru/common/Base.hpp
index 93d6f9a6..a5a9421d 100644
--- a/include/cru/common/Base.hpp
+++ b/include/cru/common/Base.hpp
@@ -7,6 +7,9 @@
#define CRU_UNUSED(entity) static_cast<void>(entity);
+#define CRU__CONCAT(a, b) a##b
+#define CRU_MAKE_UNICODE_LITERAL(str) CRU__CONCAT(u, #str)
+
#define CRU_DEFAULT_COPY(classname) \
classname(const classname&) = default; \
classname& operator=(const classname&) = default;
diff --git a/include/cru/platform/Matrix.hpp b/include/cru/platform/Matrix.hpp
index cea5198b..e702df90 100644
--- a/include/cru/platform/Matrix.hpp
+++ b/include/cru/platform/Matrix.hpp
@@ -56,8 +56,8 @@ struct Matrix {
static Matrix Rotation(float angle) {
float r = AngleToRadian(angle);
- float s = std::sinf(r);
- float c = std::cosf(r);
+ float s = std::sin(r);
+ float c = std::cos(r);
return Matrix{c, s, -s, c, 0.0f, 0.0f};
}
diff --git a/src/ui/UiHost.cpp b/src/ui/UiHost.cpp
index 0fdf2f53..48a4e06e 100644
--- a/src/ui/UiHost.cpp
+++ b/src/ui/UiHost.cpp
@@ -16,7 +16,7 @@ using platform::native::IUiApplication;
namespace event_names {
#ifdef CRU_DEBUG
// clang-format off
-#define CRU_DEFINE_EVENT_NAME(name) constexpr const char16_t* name = u#name;
+#define CRU_DEFINE_EVENT_NAME(name) constexpr const char16_t* name = CRU_MAKE_UNICODE_LITERAL(name);
// clang-format on
#else
#define CRU_DEFINE_EVENT_NAME(name) constexpr const char16_t* name = u"";
diff --git a/src/ui/controls/TextControlService.hpp b/src/ui/controls/TextControlService.hpp
index 5e423d7d..5d8d4645 100644
--- a/src/ui/controls/TextControlService.hpp
+++ b/src/ui/controls/TextControlService.hpp
@@ -199,7 +199,7 @@ class TextControlService : public Object {
}
template <typename TArgs>
- void SetupOneHandler(event::RoutedEvent<TArgs>* (TControl::*event)(),
+ void SetupOneHandler(event::RoutedEvent<TArgs>* (Control::*event)(),
void (TextControlService::*handler)(
typename event::RoutedEvent<TArgs>::EventArgs)) {
this->event_revoker_guards_.push_back(