All pastes #635028 Raw Edit

Unnamed

public text v1 · immutable
#635028 ·published 2007-07-26 19:55 UTC
rendered paste body
Index: render/katerenderer.cpp
===================================================================
--- render/katerenderer.cpp     (revision 692937)
+++ render/katerenderer.cpp     (working copy)
@@ -427,9 +427,17 @@
   }

   if (range->layout()) {
+
+
+    if(range->textLine()->attributesList().empty()) {
+         kDebug()<<"Help! No attribute!"<<endl;
+    }
+
+
     QVector<QTextLayout::FormatRange> additionalFormats;
     if (range->length() > 0) {
       // Draw the text :)
+      paint.setPen(QPen(attribute(KateExtendedAttribute::dsNormal)->foreground().color()));
       if (m_dynamicRegion.boundingRange().isValid() || (m_view->selection() && showSelections() && m_view->selectionRange().overlapsLine(range->line()))) {
         // FIXME toVector() may be a performance issue
         additionalFormats = decorationsForLine(range->textLine(), range->line(), true).toVector();
@@ -581,7 +589,7 @@
         if (range->layout()->additionalFormats().count())
           c = range->layout()->additionalFormats().last().format.foreground().color();
         else
-          c = Qt::black;
+          c = attribute(KateExtendedAttribute::dsNormal)->foreground().color();

       if (cursor->column() <= range->length()) {
         paint.save();
@@ -590,8 +598,7 @@
         // Clip the caret - Qt's caret has a habit of intruding onto other lines
         paint.setClipRect(0, line.lineNumber() * fm.height(), xEnd - xStart, fm.height());

-        // Draw the cursor, start drawing in the middle as the above sets the width from the center of the line
-        range->layout()->drawCursor(&paint, QPoint(caretWidth/2 - xStart,0), cursor->column());
+        range->layout()->drawCursor(&paint, QPoint(-xStart,0), cursor->column(), caretWidth);

         paint.restore();