Fix rectangle size for text rendering on Windows.
BUG=
TEST=
REF_BUG=
REF_CL=86939917
Hiroshi Sumita authored 8 years ago
Yohei Yukawa committed 8 years ago
0 | 0 |
MAJOR=2
|
1 | 1 |
MINOR=17
|
2 | |
BUILD=2220
|
|
2 |
BUILD=2221
|
3 | 3 |
REVISION=102
|
4 | 4 |
# NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
|
5 | 5 |
# downloaded by NaCl Mozc.
|
62 | 62 |
|
63 | 63 |
namespace {
|
64 | 64 |
|
|
65 |
WTL::CRect ToCRect(const Rect &rect) {
|
|
66 |
return WTL::CRect(rect.Left(), rect.Top(), rect.Right(), rect.Bottom());
|
|
67 |
}
|
|
68 |
|
65 | 69 |
COLORREF GetTextColor(TextRenderer::FONT_TYPE type) {
|
66 | 70 |
switch (type) {
|
67 | 71 |
case TextRenderer::FONTSET_SHORTCUT:
|
|
410 | 414 |
return;
|
411 | 415 |
}
|
412 | 416 |
CRect total_rect;
|
413 | |
for (size_t i = 0; i < display_list.size(); ++i) {
|
414 | |
const auto &item = display_list[i];
|
415 | |
total_rect.right = max(total_rect.right, item.rect.Right());
|
416 | |
total_rect.bottom = max(total_rect.right, item.rect.Bottom());
|
|
417 |
for (const auto &item : display_list) {
|
|
418 |
const auto &item_rect = ToCRect(item.rect);
|
|
419 |
total_rect.right = max(total_rect.right, item_rect.right);
|
|
420 |
total_rect.bottom = max(total_rect.bottom, item_rect.bottom);
|
417 | 421 |
}
|
418 | 422 |
HRESULT hr = S_OK;
|
419 | 423 |
hr = dc_render_target_->BindDC(dc, &total_rect);
|