MCPcopy Create free account
hub / github.com/ALTaleX531/OpenGlass / MyCDWriteText_SetSize

Method MyCDWriteText_SetSize

OpenGlass/CaptionTextHandler.cpp:955–982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

953}
954
955HRESULT 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
984HRESULT CaptionTextHandler::MyCDWriteText_InitializeVisualTreeClone(uDWM::CDWriteText* This, uDWM::CDWriteText* clonedVisual, UINT cloneOption)
985{

Callers

nothing calls this directly

Calls 3

GetVisualProxyMethod · 0.80
IsRTLMirroredMethod · 0.45
SetSizeMethod · 0.45

Tested by

no test coverage detected