changeset 932:53392b63a0ab

Implemented the "overline" text-decoration.
author corvid <corvid@lavabit.com>
date Tue, 10 Feb 2009 16:17:16 -0300
parents e18eaa188600
children cf854c99718e
files ChangeLog dw/textblock.cc
diffstat 2 files changed, 29 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Feb 09 15:02:58 2009 -0300
+++ b/ChangeLog	Tue Feb 10 16:17:16 2009 -0300
@@ -29,6 +29,7 @@
  - Added the "http_language" dillorc option for setting HTTP's Accept-Language.
  - Refactored prefs.c to a much smaller size!
  - Fixed a SEGFAULT bug on redirections without Location.
+ - Implemented the "overline" text-decoration.
    Patches: place (AKA corvid)
 +- Switched SSL-enabled to configure.in (./configure --enable-ssl).
  - Standardised the installation of dpid/dpidrc with auto* tools.
--- a/dw/textblock.cc	Mon Feb 09 15:02:58 2009 -0300
+++ b/dw/textblock.cc	Tue Feb 10 16:17:16 2009 -0300
@@ -1299,6 +1299,24 @@
                             xWorld + word->size.width + word->effSpace - 1,
                             yWorldBase + 1 + diff);
 
+         /* overline */
+         if (word->style->textDecoration &
+             core::style::TEXT_DECORATION_OVERLINE)
+            view->drawLine (color, core::style::Color::SHADING_NORMAL,
+                            xWorld,
+                            yWorldBase + diff - word->style->font->ascent + 1,
+                            xWorld + word->size.width - 1,
+                            yWorldBase + diff - word->style->font->ascent + 1);
+         if (wordIndex + 1 < line->lastWord &&
+             (word->spaceStyle->textDecoration
+              & core::style::TEXT_DECORATION_OVERLINE))
+            view->drawLine (word->spaceStyle->color,
+                            core::style::Color::SHADING_NORMAL,
+                            xWorld + word->size.width,
+                            yWorldBase + diff - word->style->font->ascent + 1,
+                            xWorld + word->size.width + word->effSpace - 1,
+                            yWorldBase + diff - word->style->font->ascent + 1);
+
          /* strike-through */
          if (word->style->textDecoration
              & core::style::TEXT_DECORATION_LINE_THROUGH)
@@ -1368,7 +1386,7 @@
                                   word->content.text + effHLStart,
                                   effHLEnd - effHLStart);
 
-                  /* underline and strike-through */
+                  /* underline, overline, and strike-through */
                   if (word->style->textDecoration
                       & core::style::TEXT_DECORATION_UNDERLINE)
                      view->drawLine (color,
@@ -1377,6 +1395,15 @@
                                      startHL + widthHL - 1,
                                      yWorldBase + 1 + diff);
                   if (word->style->textDecoration
+                      & core::style::TEXT_DECORATION_OVERLINE)
+                     view->drawLine (
+                        color,
+                        core::style::Color::SHADING_INVERSE,
+                        startHL,
+                        yWorldBase + diff - word->style->font->ascent + 1,
+                        startHL + widthHL - 1,
+                        yWorldBase + diff - word->style->font->ascent + 1);
+                  if (word->style->textDecoration
                       & core::style::TEXT_DECORATION_LINE_THROUGH)
                      view->drawRectangle (
                         color,