aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/text_control.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-11-05 20:54:48 +0800
committercrupest <crupest@outlook.com>2018-11-05 20:54:48 +0800
commit1dab244aaad8694ba37ef43caedd8c8ba0310c00 (patch)
treef70f6489a0f88520a0bdc095cd9713d03f83687b /src/ui/controls/text_control.cpp
parent252519effe30881825dd02e26dc41bd9cde34782 (diff)
downloadcru-1dab244aaad8694ba37ef43caedd8c8ba0310c00.tar.gz
cru-1dab244aaad8694ba37ef43caedd8c8ba0310c00.tar.bz2
cru-1dab244aaad8694ba37ef43caedd8c8ba0310c00.zip
...
Diffstat (limited to 'src/ui/controls/text_control.cpp')
-rw-r--r--src/ui/controls/text_control.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/ui/controls/text_control.cpp b/src/ui/controls/text_control.cpp
index 3c5d7c33..5769af58 100644
--- a/src/ui/controls/text_control.cpp
+++ b/src/ui/controls/text_control.cpp
@@ -3,6 +3,7 @@
#include "ui/window.h"
#include "graph/graph.h"
#include "exception.h"
+#include <cassert>
namespace cru::ui::controls
{
@@ -49,19 +50,6 @@ namespace cru::ui::controls
Repaint();
}
- void TextControl::AddTextLayoutHandler(TextLayoutHandlerPtr handler)
- {
- text_layout_handlers_.push_back(std::move(handler));
- }
-
- void TextControl::RemoveTextLayoutHandler(const TextLayoutHandlerPtr& handler)
- {
- const auto find_result = std::find(text_layout_handlers_.cbegin(), text_layout_handlers_.cend(),
- handler);
- if (find_result != text_layout_handlers_.cend())
- text_layout_handlers_.erase(find_result);
- }
-
void TextControl::SetSelectable(const bool is_selectable)
{
if (!is_selectable)
@@ -115,7 +103,7 @@ namespace cru::ui::controls
ThrowIfFailed(layout->GetMetrics(&text_metrics));
const auto metrics_count = text_metrics.lineCount * text_metrics.maxBidiReorderingDepth;
- Vector<DWRITE_HIT_TEST_METRICS> hit_test_metrics(metrics_count);
+ std::vector<DWRITE_HIT_TEST_METRICS> hit_test_metrics(metrics_count);
UINT32 actual_count;
layout->HitTestTextRange(
range.value().position, range.value().count,
@@ -238,8 +226,5 @@ namespace cru::ui::controls
size.width, size.height,
&text_layout_
));
-
- for (const auto& handler : text_layout_handlers_)
- (*handler)(text_layout_);
}
}