emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 404f120 3/3: Improve some NS drawing code


From: Alan Third
Subject: master 404f120 3/3: Improve some NS drawing code
Date: Sat, 12 Dec 2020 05:45:12 -0500 (EST)

branch: master
commit 404f12060ca43d100a0609f2658dd487f6a50ebd
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>

    Improve some NS drawing code
    
    * src/nsterm.m (ns_update_end): There's no need to schedule a redraw
    if nothing has been changed.
    (ns_set_vertical_scroll_bar):
    (ns_set_horizontal_scroll_bar): Fix the logic for clearing under the
    scrollbars.
    (ns_clear_under_internal_border): No need to clip, the default
    clipping rectangle will be fine.
---
 src/nsterm.m | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index 0729c96..7972fa4 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1166,7 +1166,6 @@ ns_update_end (struct frame *f)
     {
 #endif
       [NSGraphicsContext setCurrentContext:nil];
-      [view setNeedsDisplay:YES];
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
     }
   else
@@ -3056,7 +3055,7 @@ ns_clear_under_internal_border (struct frame *f)
       if (!face)
         return;
 
-      ns_focus (f, &frame_rect, 1);
+      ns_focus (f, NULL, 1);
       [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f) set];
       for (int i = 0; i < 4 ; i++)
         {
@@ -4987,8 +4986,8 @@ ns_set_vertical_scroll_bar (struct window *window,
           [bar removeFromSuperview];
           wset_vertical_scroll_bar (window, Qnil);
           [bar release];
+          ns_clear_frame_area (f, left, top, width, height);
         }
-      ns_clear_frame_area (f, left, top, width, height);
       unblock_input ();
       return;
     }
@@ -5010,7 +5009,7 @@ ns_set_vertical_scroll_bar (struct window *window,
       r.size.width = oldRect.size.width;
       if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r))
         {
-          if (oldRect.origin.x != r.origin.x)
+          if (! NSEqualRects (oldRect, r))
               ns_clear_frame_area (f, left, top, width, height);
           [bar setFrame: r];
         }
@@ -5088,8 +5087,7 @@ ns_set_horizontal_scroll_bar (struct window *window,
       oldRect = [bar frame];
       if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r))
         {
-          if (oldRect.origin.y != r.origin.y)
-            ns_clear_frame_area (f, left, top, width, height);
+          ns_clear_frame_area (f, left, top, width, height);
           [bar setFrame: r];
           update_p = YES;
         }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]