aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2012-10-08 10:44:55 +0200
committerSebastian Geerken <devnull@localhost>2012-10-08 10:44:55 +0200
commitb51b9f79bf0f2f964507905bdeb9f38621407451 (patch)
tree0ffe82cb3359c51c84370432dc65faeffcb0062c
parent24a87b2dcedb21d8d1f3c68036cf644633dd1005 (diff)
parent8bf0c66790637b072ff04746e80f97ee5485428b (diff)
Merge.
-rw-r--r--dw/textblock.cc25
-rw-r--r--dw/textblock_iterator.cc25
2 files changed, 25 insertions, 25 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index c7f254e6..ee5d4f67 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -2013,6 +2013,31 @@ void Textblock::changeWordStyle (int from, int to, core::style::Style *style,
{
}
+void Textblock::queueDrawRange (int index1, int index2)
+{
+ int from = misc::min (index1, index2);
+ int to = misc::max (index1, index2);
+
+ from = misc::min (from, words->size () - 1);
+ from = misc::max (from, 0);
+ to = misc::min (to, words->size () - 1);
+ to = misc::max (to, 0);
+
+ int line1idx = findLineOfWord (from);
+ int line2idx = findLineOfWord (to);
+
+ if (line1idx >= 0 && line2idx >= 0) {
+ Line *line1 = lines->getRef (line1idx),
+ *line2 = lines->getRef (line2idx);
+ int y = lineYOffsetWidget (line1) + line1->boxAscent -
+ line1->contentAscent;
+ int h = lineYOffsetWidget (line2) + line2->boxAscent +
+ line2->contentDescent - y;
+
+ queueDrawArea (0, y, allocation.width, h);
+ }
+}
+
void Textblock::borderChanged (int y)
{
printf ("[%p] border has changed: %d\n", this, y);
diff --git a/dw/textblock_iterator.cc b/dw/textblock_iterator.cc
index d3d8eda5..9af98137 100644
--- a/dw/textblock_iterator.cc
+++ b/dw/textblock_iterator.cc
@@ -255,31 +255,6 @@ void Textblock::TextblockIterator::unhighlight (int direction,
// TODO What about OOF widgets?
}
-void Textblock::queueDrawRange (int index1, int index2)
-{
- int from = misc::min (index1, index2);
- int to = misc::max (index1, index2);
-
- from = misc::min (from, words->size () - 1);
- from = misc::max (from, 0);
- to = misc::min (to, words->size () - 1);
- to = misc::max (to, 0);
-
- int line1idx = findLineOfWord (from);
- int line2idx = findLineOfWord (to);
-
- if (line1idx >= 0 && line2idx >= 0) {
- Line *line1 = lines->getRef (line1idx),
- *line2 = lines->getRef (line2idx);
- int y = lineYOffsetWidget (line1) + line1->boxAscent -
- line1->contentAscent;
- int h = lineYOffsetWidget (line2) + line2->boxAscent +
- line2->contentDescent - y;
-
- queueDrawArea (0, y, allocation.width, h);
- }
-}
-
void Textblock::TextblockIterator::getAllocation (int start, int end,
core::Allocation *allocation)
{