Subversion Repositories tpanel

Rev

Rev 76 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 76 Rev 118
Line 608... Line 608...
608
    }
608
    }
609
 
609
 
610
    return lines;
610
    return lines;
611
}
611
}
612
 
612
 
613
int TPage::calcLineHeight(string text, SkFont& font)
613
int TPage::calcLineHeight(const string& text, SkFont& font)
614
{
614
{
615
    DECL_TRACER("TButton::calcLineHeight(string text, SkFont& font)");
615
    DECL_TRACER("TButton::calcLineHeight(const string& text, SkFont& font)");
616
 
616
 
617
    sk_sp<SkTextBlob> blob = SkTextBlob::MakeFromString(text.c_str(), font);
617
    sk_sp<SkTextBlob> blob = SkTextBlob::MakeFromString(text.c_str(), font);
618
    SkRect rect = blob.get()->bounds();
618
    SkRect rect = blob.get()->bounds();
619
    return rect.height();
619
    return rect.height();
620
}
620
}
Line 875... Line 875...
875
            }
875
            }
876
 
876
 
877
            vector<string>::iterator iter;
877
            vector<string>::iterator iter;
878
            int line = 0;
878
            int line = 0;
879
 
879
 
880
            for (iter = textLines.begin(); iter != textLines.end(); iter++)
880
            for (iter = textLines.begin(); iter != textLines.end(); ++iter)
881
            {
881
            {
882
                sk_sp<SkTextBlob> blob = SkTextBlob::MakeFromString(iter->c_str(), skFont);
882
                sk_sp<SkTextBlob> blob = SkTextBlob::MakeFromString(iter->c_str(), skFont);
883
                SkRect rect;
883
                SkRect rect;
884
                skFont.measureText(iter->c_str(), iter->length(), SkTextEncoding::kUTF8, &rect, &paint);
884
                skFont.measureText(iter->c_str(), iter->length(), SkTextEncoding::kUTF8, &rect, &paint);
885
                POSITION_t pos = calcImagePosition(rect.width(), lineHeight, SC_TEXT, 1);
885
                POSITION_t pos = calcImagePosition(rect.width(), lineHeight, SC_TEXT, 1);