Am 10.12.2010 um 18:34 schrieb Pavel Sanda:

> Stephan Witt wrote:
>> Looks ok - I cannot see any artifacts. Of course this isn't any evidence. 
> 
> Stephan what is the current state-of-art patch for 7120?

See the attached patch.

Stephan

Index: src/rowpainter.cpp
===================================================================
--- src/rowpainter.cpp  (Revision 36843)
+++ src/rowpainter.cpp  (Arbeitskopie)
@@ -63,6 +63,13 @@
          xo_(x), yo_(y), width_(text_metrics_.width())
 {
        bidi_.computeTables(par_, pi_.base.bv->buffer(), row_);
+       // derive the line thickness from zoom factor
+       // the zoom is given in percent
+       scale_ = lyxrc.zoom / 100.0;
+       // (increase thickness at 150%, 250% etc.)
+       line_thickness_ = scale_ < 1.0 ? 1.0 : int(scale_ + 0.5);
+       line_offset_ = int(1.5 * line_thickness_) + (scale_ < 1.0 ? 1 : 2);
+
        x_ = row_.x + xo_;
 
        //lyxerr << "RowPainter: x: " << x_ << " xo: " << xo_ << " yo: " << yo_ 
<< endl;
@@ -349,20 +356,19 @@
        if (lang == pi_.base.bv->buffer().params().language)
                return;
 
-       int const y = yo_ + 1 + desc;
-       pi_.pain.line(int(orig_x), y, int(x_), y, Color_language);
+       int const y = yo_ + 1 + desc + int(line_thickness_/2);
+       pi_.pain.line(int(orig_x), y, int(x_), y, Color_language,
+               Painter::line_solid, line_thickness_);
 }
 
 
-void RowPainter::paintMisspelledMark(double orig_x, int desc, bool changed)
+void RowPainter::paintMisspelledMark(double orig_x, bool changed)
 {
-       // derive the offset from zoom factor specified by user in percent
        // if changed the misspelled marker gets placed slightly lower than 
normal
        // to avoid drawing at the same vertical offset
-       int const offset = int(1.5 * lyxrc.zoom / 100.0); // [percent]
-       int const y = yo_ + desc + (changed ? offset : 0) + 1;
+       int const y = yo_ + (changed ? line_thickness_ + 1 : 0) + line_offset_;
        pi_.pain.line(int(orig_x), y, int(x_), y, Color_error,
-               Painter::line_onoffdash, 2.0);
+               Painter::line_onoffdash, line_thickness_);
 }
 
 
@@ -399,7 +405,7 @@
        paintForeignMark(orig_x, orig_font.language());
 
        if (lyxrc.spellcheck_continuously && misspelled_) {
-               paintMisspelledMark(orig_x, 2, changed);
+               paintMisspelledMark(orig_x, changed);
        }
 }
 
@@ -854,9 +860,9 @@
                        FontMetrics const & fm
                                = 
theFontMetrics(pi_.base.bv->buffer().params().getFont());
                        int const y_bar = change_running.deleted() ?
-                               yo_ - fm.maxAscent() / 3 : yo_ + fm.maxAscent() 
/ 6;
+                               yo_ - fm.maxAscent() / 3 : yo_ + line_offset_;
                        pi_.pain.line(change_last_x, y_bar, int(x_), y_bar,
-                               change_running.color(), Painter::line_solid, 
0.5);
+                               change_running.color(), Painter::line_solid, 
line_thickness_);
 
                        // Change might continue with a different author or type
                        if (change.changed() && !highly_editable_inset) {
@@ -914,9 +920,9 @@
                FontMetrics const & fm
                        = 
theFontMetrics(pi_.base.bv->buffer().params().getFont());
                int const y_bar = change_running.deleted() ?
-                               yo_ - fm.maxAscent() / 3 : yo_ + fm.maxAscent() 
/ 6;
+                               yo_ - fm.maxAscent() / 3 : yo_ + line_offset_;
                pi_.pain.line(change_last_x, y_bar, int(x_), y_bar,
-                       change_running.color(), Painter::line_solid, 0.5);
+                       change_running.color(), Painter::line_solid, 
line_thickness_);
                change_running.setUnchanged();
        }
 }
Index: src/rowpainter.h
===================================================================
--- src/rowpainter.h    (Revision 36843)
+++ src/rowpainter.h    (Arbeitskopie)
@@ -59,7 +59,7 @@
 
 private:
        void paintForeignMark(double orig_x, Language const * lang, int desc = 
0);
-       void paintMisspelledMark(double orig_x, int desc, bool changed);
+       void paintMisspelledMark(double orig_x, bool changed);
        void paintHebrewComposeChar(pos_type & vpos, FontInfo const & font);
        void paintArabicComposeChar(pos_type & vpos, FontInfo const & font);
        void paintChars(pos_type & vpos, FontInfo const & font,
@@ -68,7 +68,7 @@
        void paintFromPos(pos_type & vpos, bool changed);
        void paintInset(Inset const * inset, pos_type const pos);
        void paintInlineCompletion(Font const & font);
-       
+
        /// return left margin
        int leftMargin() const;
 
@@ -104,6 +104,9 @@
        int const yo_;    // current baseline
        double x_;
        int width_;
+       double scale_;
+       int line_thickness_;
+       int line_offset_;
 };
 
 } // namespace lyx

Reply via email to