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

Method MyCDWriteText_UpdateOffset

OpenGlass/CaptionTextHandler.cpp:931–953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

929}
930
931HRESULT CaptionTextHandler::MyCDWriteText_UpdateOffset(uDWM::CDWriteText* This)
932{
933 if (!g_textGlowSize)
934 {
935 return g_CDWriteText_UpdateOffset_Org(This);
936 }
937
938 // SpriteVisual will crop what exceeds its bounding rectangle,
939 // here we make it offset x minus the size of the glow,
940 // and add it back later in the ICompositionSurfaceBrush2::put_Offset method
941 //
942 // This gives us enough space to render the glow.
943 auto& offset = const_cast<POINT&>(This->GetOffset());
944 const auto actualOffsetX = offset.x;
945 if (!This->IsRTLMirrored())
946 {
947 offset.x = std::max(offset.x - g_textGlowSize, 0l);
948 }
949 const auto hr = g_CDWriteText_UpdateOffset_Org(This);
950 offset.x = actualOffsetX;
951
952 return hr;
953}
954
955HRESULT CaptionTextHandler::MyCDWriteText_SetSize(uDWM::CDWriteText* This, const SIZE* size)
956{

Callers

nothing calls this directly

Calls 1

IsRTLMirroredMethod · 0.45

Tested by

no test coverage detected