OSDN Git Service

iTerm svn trunk r1714 with fixing drawRect
authorKazuki Sakamoto <sakamoto@splhack.org>
Sat, 14 Mar 2009 09:23:40 +0000 (18:23 +0900)
committerKazuki Sakamoto <sakamoto@splhack.org>
Sat, 14 Mar 2009 09:23:40 +0000 (18:23 +0900)
Readme.txt
aqua/iTerm/Portfile
aqua/iTerm/files/patch-PTYTextView.m

index c45e8a2..a806a93 100644 (file)
@@ -1,5 +1,5 @@
   ctags @5.6j1_1 (active)
   fmdiff @7819_0 (active)
-  iTerm @0.9.6_20090313 (active)
+  iTerm @0.9.6_20090314 (active)
   vim @7.2.132_0+cscope+gdb+huge+my+ruby (active)
   zsh-devel @4.3.9_1+cjk+mp_completion+pcre (active)
index 301dc92..7885715 100644 (file)
@@ -3,7 +3,7 @@
 PortSystem 1.0
 name           iTerm
 version                0.9.6
-revision       20090313
+revision       20090314
 categories     aqua shells
 maintainers    waqar@macports.org
 description    Enhanced terminal emulator program for Mac OS X
@@ -21,7 +21,7 @@ distfiles
 patchfiles-append patch-PTYSession.m patch-PTYTextView.m
 fetch.type     svn
 svn.url                https://iterm.svn.sourceforge.net/svnroot/iterm/trunk iTerm
-svn.tag                1713
+svn.tag                1714
 
 worksrcdir     ${name}
 use_configure  no
index 59a452c..ca7c59f 100644 (file)
@@ -1,7 +1,7 @@
 --- PTYTextView.m
 +++ PTYTextView.m
-@@ -89,7 +89,7 @@
-     
+@@ -92,7 +92,7 @@ static BOOL tigerOrLater;
      [self setMarkedTextAttributes:
          [NSDictionary dictionaryWithObjectsAndKeys:
 -            [NSColor yellowColor], NSBackgroundColorAttributeName,
@@ -9,7 +9,7 @@
              [NSColor blackColor], NSForegroundColorAttributeName,
              nafont, NSFontAttributeName,
              [NSNumber numberWithInt:2],NSUnderlineStyleAttributeName,
-@@ -493,7 +493,7 @@
+@@ -444,7 +444,7 @@ static BOOL tigerOrLater;
      nafont=naFont;
      [self setMarkedTextAttributes:
          [NSDictionary dictionaryWithObjectsAndKeys:
              [NSColor blackColor], NSForegroundColorAttributeName,
              nafont, NSFontAttributeName,
              [NSNumber numberWithInt:2],NSUnderlineStyleAttributeName,
+@@ -712,6 +712,7 @@ static BOOL tigerOrLater;
+       struct timeval now;
+       int oldTopLine, oldBottomLine;
+       int bgstart;
++      int bgwidth;
+       BOOL bgselected = NO;
+       BOOL hasBGImage = [(PTYScrollView *)[self enclosingScrollView] backgroundImage] != nil;
+@@ -816,6 +817,7 @@ static BOOL tigerOrLater;
+               // Contiguous sections of background with the same colour
+               // are combined into runs and draw as one operation
+               bgstart = -1;
++              bgwidth = 0;
+               j = 0;
+               while(j <= WIDTH) {
+                       selected = [self _isCharSelectedInRow:line col:j checkOld:NO];
+@@ -826,22 +828,26 @@ static BOOL tigerOrLater;
+                               (dirty && dirty[j]) ||
+                               (theLine[j].fg_color & BLINK_MASK)
+                       );
++                      double_width = j<WIDTH-1 && (theLine[j+1].ch == 0xffff);
+                       if(need_draw && bgstart < 0) {
+                               // Start new run
+                               bgstart = j;
++                              bgwidth = 0;
+                               bgcode = theLine[j].bg_color;
+                               bgselected = selected;
+                       }
+                       if(need_draw && bgselected == selected && theLine[j].bg_color == bgcode) {
+                               // Continue the run
++                              bgwidth += double_width ? 2 : 1;
+                               j++;
+                       }
+                       else if(bgstart >= 0) {
+                               // This run is finished, draw it
+-                              bgRect = NSMakeRect(floor(curX+bgstart*charWidth),curY-lineHeight,ceil((j-bgstart)*charWidth),lineHeight);
++                              bgRect = NSMakeRect(floor(curX+bgstart*charWidth),curY-lineHeight,ceil(bgwidth*charWidth),lineHeight);
+                               bgstart = -1;
++                              bgwidth = 0;
+                               if(hasBGImage) {
+                                       [(PTYScrollView *)[self enclosingScrollView] drawBackgroundImageRect: bgRect];
+@@ -855,6 +861,7 @@ static BOOL tigerOrLater;
+                       }
+                       else {
+                               // Don't need to draw and not on a run, move to next char
++                              bgwidth += double_width ? 2 : 1;
+                               j++;
+                       }
+               }
+@@ -2542,12 +2549,12 @@ static BOOL tigerOrLater;
+       
+       
+       crap = [NSString stringWithCharacters:&code length:1];          
+-      [crap drawAtPoint:NSMakePoint(X,Y-lineHeight) withAttributes:attrib];
++      [crap drawAtPoint:NSMakePoint(X,Y-lineHeight*(dw?1.0f:1.25f)) withAttributes:attrib];
+       
+       // on older systems, for bold, redraw the character offset by 1 pixel
+       if (renderBold && (!tigerOrLater || !antiAlias))
+       {
+-              [crap drawAtPoint:NSMakePoint(X+1,Y-lineHeight)  withAttributes:attrib];
++              [crap drawAtPoint:NSMakePoint(X+1,Y-lineHeight*(dw?1.0f:1.25f))  withAttributes:attrib];
+       }
+ }