[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-30 bd6dfb97ff0: NS: Fix scroll-bar setting code (bug#72331)
From: |
Gerd Moellmann |
Subject: |
emacs-30 bd6dfb97ff0: NS: Fix scroll-bar setting code (bug#72331) |
Date: |
Fri, 9 Aug 2024 01:21:57 -0400 (EDT) |
branch: emacs-30
commit bd6dfb97ff0d712dc02c0542a51b00ce41022012
Author: Gerd Möllmann <gerd@gnu.org>
Commit: Gerd Möllmann <gerd@gnu.org>
NS: Fix scroll-bar setting code (bug#72331)
* src/nsterm.m (ns_set_vertical_scroll_bar): Use
WINDOW_SCROLL_AREA_WIDTH instead of NS_SCROLL_BAR_WIDTH.
(ns_set_horizontal_scroll_bar): Use WINDOW_SCROLL_AREA_HEIGHT
instead of NS_SCROLL_BAR_HEIGHT. Clear area differently if vertical
scroll bars are present.
* src/nsterm.h (NS_SCROLL_BAR_WIDTH, NS_SCROLL_BAR_HEIGHT): Remove.
---
src/nsterm.h | 16 ----------------
src/nsterm.m | 6 +++---
2 files changed, 3 insertions(+), 19 deletions(-)
diff --git a/src/nsterm.h b/src/nsterm.h
index a07829a36ec..6c67653705e 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -1069,22 +1069,6 @@ struct x_output
styleMask:[[FRAME_NS_VIEW (f) window] styleMask]]) \
- NSHeight([[[FRAME_NS_VIEW (f) window] contentView] frame])))
-/* Compute pixel size for vertical scroll bars. */
-#define NS_SCROLL_BAR_WIDTH(f) \
- (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \
- ? rint (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0 \
- ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f) \
- : (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f))) \
- : 0)
-
-/* Compute pixel size for horizontal scroll bars. */
-#define NS_SCROLL_BAR_HEIGHT(f)
\
- (FRAME_HAS_HORIZONTAL_SCROLL_BARS (f)
\
- ? rint (FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) > 0 \
- ? FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) \
- : (FRAME_SCROLL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f))) \
- : 0)
-
/* Difference between char-column-calculated and actual SB widths.
This is only a concern for rendering when SB on left. */
#define NS_SCROLL_BAR_ADJUST(w, f) \
diff --git a/src/nsterm.m b/src/nsterm.m
index b883e605a5b..905707dace4 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -5067,7 +5067,7 @@ ns_set_vertical_scroll_bar (struct window *window,
window_box (window, ANY_AREA, 0, &window_y, 0, &window_height);
top = window_y;
height = window_height;
- width = NS_SCROLL_BAR_WIDTH (f);
+ width = WINDOW_SCROLL_BAR_AREA_WIDTH (window);
left = WINDOW_SCROLL_BAR_AREA_X (window);
r = NSMakeRect (left, top, width, height);
@@ -5161,7 +5161,7 @@ ns_set_horizontal_scroll_bar (struct window *window,
window_box (window, ANY_AREA, &window_x, 0, &window_width, 0);
left = window_x;
width = window_width;
- height = NS_SCROLL_BAR_HEIGHT (f);
+ height = WINDOW_SCROLL_BAR_AREA_HEIGHT (window);
top = WINDOW_SCROLL_BAR_AREA_Y (window);
r = NSMakeRect (left, top, width, height);
@@ -5199,7 +5199,7 @@ ns_set_horizontal_scroll_bar (struct window *window,
it fills with junk. */
if (!NILP (window->vertical_scroll_bar))
ns_clear_frame_area (f, WINDOW_SCROLL_BAR_AREA_X (window), top,
- NS_SCROLL_BAR_HEIGHT (f), height);
+ WINDOW_SCROLL_BAR_AREA_WIDTH (window), height);
if (update_p)
[bar setPosition: position portion: portion whole: whole];
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-30 bd6dfb97ff0: NS: Fix scroll-bar setting code (bug#72331),
Gerd Moellmann <=