mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Implemented ContourMask (mask for text fields)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@251 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -468,6 +468,11 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
|
||||
line.separator_after = false;
|
||||
// reset line_size
|
||||
line_size = RealSize(lineLeft(dc, style, line.top), 0);
|
||||
while (line.top < style.height && line_size.width + 1 >= style.width - style.padding_right) {
|
||||
// nothing fits on this line, move down one pixel
|
||||
line.top += 1;
|
||||
line_size = RealSize(lineLeft(dc, style, line.top), 0);
|
||||
}
|
||||
line.positions.push_back(line_size.width); // start position
|
||||
}
|
||||
}
|
||||
@@ -487,17 +492,12 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
|
||||
}
|
||||
|
||||
double TextViewer::lineLeft(RotatedDC& dc, const TextStyle& style, double y) {
|
||||
return 0 + style.padding_left;
|
||||
// return style.mask.rowLeft(y, dc.getInternalSize()) + style.padding_left;
|
||||
return style.mask.rowLeft(y, dc.getInternalSize()) + style.padding_left;
|
||||
}
|
||||
double TextViewer::lineRight(RotatedDC& dc, const TextStyle& style, double y) {
|
||||
return style.width - style.padding_right;
|
||||
// return style.mask.rowRight(y, dc.getInternalSize()) - style.padding_right;
|
||||
return style.mask.rowRight(y, dc.getInternalSize()) - style.padding_right;
|
||||
}
|
||||
|
||||
ContourMask::ContourMask() {} // MOVEME //@@
|
||||
ContourMask::~ContourMask() {}
|
||||
|
||||
void TextViewer::alignLines(RotatedDC& dc, const vector<CharInfo>& chars, const TextStyle& style) {
|
||||
if (style.alignment == ALIGN_TOP_LEFT) return;
|
||||
// Find height of the text, don't count the last lines if they are empty
|
||||
|
||||
Reference in New Issue
Block a user