本文整理汇总了C++中Glyph::GetBackgroundSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Glyph::GetBackgroundSize方法的具体用法?C++ Glyph::GetBackgroundSize怎么用?C++ Glyph::GetBackgroundSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Glyph
的用法示例。
在下文中一共展示了Glyph::GetBackgroundSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Lookup
//.........这里部分代码省略.........
CSize size(0, 0);
if(s->m_direction.secondary == _T("left") || s->m_direction.secondary == _T("up")) {
ReverseList(rows);
}
for(POSITION pos = rows.GetHeadPosition(); pos; rows.GetNext(pos)) {
Row* r = rows.GetAt(pos);
if(s->m_direction.primary == _T("left") || s->m_direction.primary == _T("up")) {
ReverseList(*r);
}
int w = 0, h = 0;
r->width = 0;
for(POSITION gpos = r->GetHeadPosition(); gpos; r->GetNext(gpos)) {
const Glyph* g = r->GetAt(gpos);
w += g->width;
if(gpos) {
w += g->spacing;
}
h = max(h, g->ascent + g->descent);
r->width += g->width;
if(gpos) {
r->width += g->spacing;
}
r->ascent = max(r->ascent, g->ascent);
r->descent = max(r->descent, g->descent);
r->border = max(r->border, g->GetBackgroundSize());
}
for(POSITION gpos = r->GetHeadPosition(); gpos; r->GetNext(gpos)) {
Glyph* g = r->GetAt(gpos);
g->row_ascent = r->ascent;
g->row_descent = r->descent;
}
if(vertical) {
size.cx += h;
size.cy = max(size.cy, w);
} else {
size.cx = max(size.cx, w);
size.cy += h;
}
}
// align rows and calc glyph positions
rs = DNew RenderedSubtitle(spdrc, clip);
CPoint p = GetAlignPoint(style.placement, scale, frame, size);
CPoint org = GetAlignPoint(style.placement, scale, frame);
// collision detection
if(!s->m_animated) {
int tlb = !rows.IsEmpty() ? rows.GetHead()->border : 0;
int brb = !rows.IsEmpty() ? rows.GetTail()->border : 0;
CRect r(p, size);
m_sra.GetRect(r, s, style.placement.align, tlb, brb);