diff options
| author | YAMAMOTO Mitsuharu | 2008-09-02 08:19:39 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2008-09-02 08:19:39 +0000 |
| commit | 935d4a636647778e596de3b309a0af4c64159124 (patch) | |
| tree | 99b9040f422df2a02148936a04d6eb03c315e557 /src | |
| parent | 7f02dd2cf6cb7395cb06104fd052f08cc91e9e10 (diff) | |
| download | emacs-935d4a636647778e596de3b309a0af4c64159124.tar.gz emacs-935d4a636647778e596de3b309a0af4c64159124.zip | |
(mac_draw_rectangle) [USE_CG_DRAWING]: Fix rectangle calculation.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/macterm.c | 51 |
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 @@ | |||
| 1 | 2008-09-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * macterm.c (mac_draw_rectangle) [USE_CG_DRAWING]: | ||
| 4 | Fix rectangle calculation. | ||
| 5 | |||
| 1 | 2008-08-30 Glenn Morris <rgm@gnu.org> | 6 | 2008-08-30 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * frame.c (Fmodify_frame_parameters): Doc fix. | 8 | * 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) | |||
| 476 | unsigned int width, height; | 476 | unsigned int width, height; |
| 477 | { | 477 | { |
| 478 | #if USE_CG_DRAWING | 478 | #if USE_CG_DRAWING |
| 479 | { | 479 | CGContextRef context; |
| 480 | CGContextRef context; | ||
| 481 | 480 | ||
| 482 | context = mac_begin_cg_clip (f, gc); | 481 | context = mac_begin_cg_clip (f, gc); |
| 483 | CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc); | 482 | CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc); |
| 484 | CGContextFillRect (context, mac_rect_make (f, x, y, width, height)); | 483 | CGContextFillRect (context, mac_rect_make (f, x, y, width, height)); |
| 485 | mac_end_cg_clip (f); | 484 | mac_end_cg_clip (f); |
| 486 | } | ||
| 487 | #else | 485 | #else |
| 488 | { | 486 | Rect r; |
| 489 | Rect r; | ||
| 490 | 487 | ||
| 491 | mac_begin_clip (f, gc); | 488 | mac_begin_clip (f, gc); |
| 492 | RGBBackColor (GC_BACK_COLOR (gc)); | 489 | RGBBackColor (GC_BACK_COLOR (gc)); |
| 493 | SetRect (&r, x, y, x + width, y + height); | 490 | SetRect (&r, x, y, x + width, y + height); |
| 494 | EraseRect (&r); | 491 | EraseRect (&r); |
| 495 | RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); | 492 | RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); |
| 496 | mac_end_clip (f, gc); | 493 | mac_end_clip (f, gc); |
| 497 | } | ||
| 498 | #endif | 494 | #endif |
| 499 | } | 495 | } |
| 500 | 496 | ||
| @@ -517,16 +513,14 @@ mac_clear_window (f) | |||
| 517 | struct frame *f; | 513 | struct frame *f; |
| 518 | { | 514 | { |
| 519 | #if USE_CG_DRAWING | 515 | #if USE_CG_DRAWING |
| 520 | { | 516 | CGContextRef context; |
| 521 | CGContextRef context; | 517 | GC gc = FRAME_NORMAL_GC (f); |
| 522 | GC gc = FRAME_NORMAL_GC (f); | 518 | |
| 523 | 519 | context = mac_begin_cg_clip (f, NULL); | |
| 524 | context = mac_begin_cg_clip (f, NULL); | 520 | CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc); |
| 525 | CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc); | 521 | CGContextFillRect (context, CGRectMake (0, 0, FRAME_PIXEL_WIDTH (f), |
| 526 | CGContextFillRect (context, CGRectMake (0, 0, FRAME_PIXEL_WIDTH (f), | 522 | FRAME_PIXEL_HEIGHT (f))); |
| 527 | FRAME_PIXEL_HEIGHT (f))); | 523 | mac_end_cg_clip (f); |
| 528 | mac_end_cg_clip (f); | ||
| 529 | } | ||
| 530 | #else /* !USE_CG_DRAWING */ | 524 | #else /* !USE_CG_DRAWING */ |
| 531 | mac_begin_clip (f, NULL); | 525 | mac_begin_clip (f, NULL); |
| 532 | RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); | 526 | RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); |
| @@ -840,11 +834,12 @@ mac_draw_rectangle (f, gc, x, y, width, height) | |||
| 840 | { | 834 | { |
| 841 | #if USE_CG_DRAWING | 835 | #if USE_CG_DRAWING |
| 842 | CGContextRef context; | 836 | CGContextRef context; |
| 837 | CGRect rect; | ||
| 843 | 838 | ||
| 844 | context = mac_begin_cg_clip (f, gc); | 839 | context = mac_begin_cg_clip (f, gc); |
| 845 | CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND (context, gc); | 840 | CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND (context, gc); |
| 846 | CGContextStrokeRect (context, | 841 | rect = mac_rect_make (f, x, y, width + 1, height + 1); |
| 847 | CGRectMake (x + 0.5f, y + 0.5f, width, height)); | 842 | CGContextStrokeRect (context, CGRectInset (rect, 0.5f, 0.5f)); |
| 848 | mac_end_cg_clip (f); | 843 | mac_end_cg_clip (f); |
| 849 | #else | 844 | #else |
| 850 | Rect r; | 845 | Rect r; |