added overdrawDC for drawing selection

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@107 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-10 18:28:26 +00:00
parent 95a5c2f42b
commit 2f1b2756ee
5 changed files with 76 additions and 32 deletions
+2 -2
View File
@@ -95,8 +95,8 @@ void TextViewer::drawSelection(RotatedDC& dc, const TextStyle& style, size_t sel
void TextViewer::Line::drawSelection(RotatedDC& dc, size_t sel_start, size_t sel_end) {
if (!visible(dc)) return;
if (sel_start < end() && sel_end > start) {
double x1 = positions[sel_start];
double x2 = positions[min(end(), sel_end)];
double x1 = positions[sel_start - start];
double x2 = positions[min(end(), sel_end) - start];
dc.DrawRectangle(RealRect(x1, top, x2 - x1, line_height));
}
}