Codebase list mozc / 4474b76
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
2 changed file(s) with 9 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
00 MAJOR=2
11 MINOR=17
2 BUILD=2220
2 BUILD=2221
33 REVISION=102
44 # NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
55 # downloaded by NaCl Mozc.
6262
6363 namespace {
6464
65 WTL::CRect ToCRect(const Rect &rect) {
66 return WTL::CRect(rect.Left(), rect.Top(), rect.Right(), rect.Bottom());
67 }
68
6569 COLORREF GetTextColor(TextRenderer::FONT_TYPE type) {
6670 switch (type) {
6771 case TextRenderer::FONTSET_SHORTCUT:
410414 return;
411415 }
412416 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);
417421 }
418422 HRESULT hr = S_OK;
419423 hr = dc_render_target_->BindDC(dc, &total_rect);