Added GraphControl; FilteredCardList; ValueEditor

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@74 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-11-19 18:59:33 +00:00
parent ce6a83e34b
commit ed336dea06
31 changed files with 705 additions and 82 deletions
+6 -2
View File
@@ -11,7 +11,7 @@
// ----------------------------------------------------------------------------- : FontTextElement
void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, DrawWhat what, size_t start, size_t end) const {
void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, double* xs, DrawWhat what, size_t start, size_t end) const {
dc.SetFont(font->font, font->size * scale);
if (end != start && text.substr(end-1, 1) == _("\n")) end -= 1; // don't draw the newline character at the end
@@ -42,7 +42,7 @@ void FontTextElement::getCharInfo(RotatedDC& dc, double scale, vector<CharInfo>&
double prev_width = 0;
for (size_t i = start ; i < end ; ++i) {
Char c = text.GetChar(i);
RealSize s = dc.GetTextExtent(text.substr(start, i - start));
RealSize s = dc.GetTextExtent(text.substr(start, i - start + 1));
out.push_back(CharInfo(RealSize(s.width - prev_width, s.height),
c == _('\n') ? BREAK_HARD :
c == _(' ') ? BREAK_SOFT : BREAK_NO
@@ -50,3 +50,7 @@ void FontTextElement::getCharInfo(RotatedDC& dc, double scale, vector<CharInfo>&
prev_width = s.width;
}
}
double FontTextElement::minScale() const {
return 1; // TODO
}