summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2008-09-02 08:19:39 +0000
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2008-09-02 08:19:39 +0000
commit935d4a636647778e596de3b309a0af4c64159124 (patch)
tree99b9040f422df2a02148936a04d6eb03c315e557
parent7f02dd2cf6cb7395cb06104fd052f08cc91e9e10 (diff)
downloademacs-935d4a636647778e596de3b309a0af4c64159124.tar.gz
(mac_draw_rectangle) [USE_CG_DRAWING]: Fix rectangle calculation.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/macterm.c51
2 files changed, 28 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 15e32fab73e..f19310aafbb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * macterm.c (mac_draw_rectangle) [USE_CG_DRAWING]:
+ Fix rectangle calculation.
+
2008-08-30 Glenn Morris <rgm@gnu.org>
* frame.c (Fmodify_frame_parameters): Doc fix.
diff --git a/src/macterm.c b/src/macterm.c
index 940dac3f7b3..d0012e1116f 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -476,25 +476,21 @@ mac_erase_rectangle (f, gc, x, y, width, height)
unsigned int width, height;
{
#if USE_CG_DRAWING
- {
- CGContextRef context;
+ CGContextRef context;
- context = mac_begin_cg_clip (f, gc);
- CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
- CGContextFillRect (context, mac_rect_make (f, x, y, width, height));
- mac_end_cg_clip (f);
- }
+ context = mac_begin_cg_clip (f, gc);
+ CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
+ CGContextFillRect (context, mac_rect_make (f, x, y, width, height));
+ mac_end_cg_clip (f);
#else
- {
- Rect r;
+ Rect r;
- mac_begin_clip (f, gc);
- RGBBackColor (GC_BACK_COLOR (gc));
- SetRect (&r, x, y, x + width, y + height);
- EraseRect (&r);
- RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
- mac_end_clip (f, gc);
- }
+ mac_begin_clip (f, gc);
+ RGBBackColor (GC_BACK_COLOR (gc));
+ SetRect (&r, x, y, x + width, y + height);
+ EraseRect (&r);
+ RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
+ mac_end_clip (f, gc);
#endif
}
@@ -517,16 +513,14 @@ mac_clear_window (f)
struct frame *f;
{
#if USE_CG_DRAWING
- {
- CGContextRef context;
- GC gc = FRAME_NORMAL_GC (f);
-
- context = mac_begin_cg_clip (f, NULL);
- CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
- CGContextFillRect (context, CGRectMake (0, 0, FRAME_PIXEL_WIDTH (f),
- FRAME_PIXEL_HEIGHT (f)));
- mac_end_cg_clip (f);
- }
+ CGContextRef context;
+ GC gc = FRAME_NORMAL_GC (f);
+
+ context = mac_begin_cg_clip (f, NULL);
+ CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
+ CGContextFillRect (context, CGRectMake (0, 0, FRAME_PIXEL_WIDTH (f),
+ FRAME_PIXEL_HEIGHT (f)));
+ mac_end_cg_clip (f);
#else /* !USE_CG_DRAWING */
mac_begin_clip (f, NULL);
RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
@@ -840,11 +834,12 @@ mac_draw_rectangle (f, gc, x, y, width, height)
{
#if USE_CG_DRAWING
CGContextRef context;
+ CGRect rect;
context = mac_begin_cg_clip (f, gc);
CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND (context, gc);
- CGContextStrokeRect (context,
- CGRectMake (x + 0.5f, y + 0.5f, width, height));
+ rect = mac_rect_make (f, x, y, width + 1, height + 1);
+ CGContextStrokeRect (context, CGRectInset (rect, 0.5f, 0.5f));
mac_end_cg_clip (f);
#else
Rect r;