| 953 | } |
| 954 | |
| 955 | HRESULT CaptionTextHandler::MyCDWriteText_SetSize(uDWM::CDWriteText* This, const SIZE* size) |
| 956 | { |
| 957 | if (!g_textGlowSize) |
| 958 | { |
| 959 | return g_CDWriteText_SetSize_Org(This, size); |
| 960 | } |
| 961 | |
| 962 | const auto hr = g_CDWriteText_SetSize_Org(This, size); |
| 963 | // SpriteVisual will crop what exceeds its bounding rectangle, |
| 964 | // expand it to ensure enough space to render the glow. |
| 965 | auto& offset = const_cast<POINT&>(This->GetOffset()); |
| 966 | if (This->IsRTLMirrored()) |
| 967 | { |
| 968 | This->GetVisualProxy()->SetSize( |
| 969 | static_cast<double>(size->cx + offset.x - std::max(offset.x - g_textGlowSize, 0l)), |
| 970 | static_cast<double>(size->cy) |
| 971 | ); |
| 972 | } |
| 973 | else |
| 974 | { |
| 975 | This->GetVisualProxy()->SetSize( |
| 976 | static_cast<double>(size->cx + offset.x - std::max(offset.x - g_textGlowSize, 0l) + g_textGlowSize), |
| 977 | static_cast<double>(size->cy) |
| 978 | ); |
| 979 | } |
| 980 | |
| 981 | return hr; |
| 982 | } |
| 983 | |
| 984 | HRESULT CaptionTextHandler::MyCDWriteText_InitializeVisualTreeClone(uDWM::CDWriteText* This, uDWM::CDWriteText* clonedVisual, UINT cloneOption) |
| 985 | { |
nothing calls this directly
no test coverage detected