Reputation: 548
I have implemented IDWriteInlineObject interface to draw ID2D1Bitmap as inline object inside a text. Everything works fine except one: my implementation's GetOverhangMetrics method never get called.
I've also tried a sample from DirectWrite SDK samples (PadWrite Layout Sample, https://msdn.microsoft.com/en-us/library/windows/desktop/dd941792%28v=vs.85%29.aspx). And got the same result ('InlineImage::GetOverhangMetrics' in InlineImage.cpp is never called).
Therefore my question is why one's implementation of GetOverhangMetrics method never get called?
Upvotes: 1
Views: 169
Reputation: 191
GetOverhangMetrics is called for an inline object when the same method is called explicitly on the text layout object containing this inline object.
Upvotes: 1
Reputation: 1179
I admit I haven't tested this, so just a thought - I think it's possible it's called when you ask for overhang metrics of layout itself, so when layout method GetOverhangMetrics() is called it feels like it would accumulate not only regular text overhang boxes, but inline object boxes too.
Upvotes: 2