From 0ce6887af823d660fdf78b6b26f36733d5dfbbda Mon Sep 17 00:00:00 2001 From: rmottola Date: Mon, 5 Jan 2015 14:24:28 +0000 Subject: [PATCH] floor rects git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38278 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 3 +++ Source/NSBox.m | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 823f1c06b..650585e44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * Source/GSToolbarView.m (menuForEvent) Use protocol not class for NSMenuItem. + * Source/NSBox.m + floor() rects. + 2014-12-26 German Arias * Source/NSWindow.m (_checkTrackingRectangles:forEvent:): Use the diff --git a/Source/NSBox.m b/Source/NSBox.m index 703f7ad5d..096b8e4df 100644 --- a/Source/NSBox.m +++ b/Source/NSBox.m @@ -3,7 +3,7 @@ Simple box view that can display a border and title - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 @@ -734,7 +734,7 @@ - (2 * borderSize.height); // center the title cell - c = (_bounds.size.width - titleSize.width) / 2; + c = floor((_bounds.size.width - titleSize.width) / 2); if (c < 0) c = 0; _title_rect.origin.x = _bounds.origin.x + c; _title_rect.origin.y = _bounds.origin.y + _border_rect.size.height @@ -770,7 +770,7 @@ r.size.height -= titleSize.height + borderSize.height; // center the title cell - c = (_border_rect.size.width - titleSize.width) / 2; + c = floor((_border_rect.size.width - titleSize.width) / 2); if (c < 0) c = 0; _title_rect.origin.x = _border_rect.origin.x + c; _title_rect.origin.y @@ -825,7 +825,7 @@ // r.size.height -= titleSize.height + borderSize.height; // center the title cell - c = (_border_rect.size.width - titleSize.width) / 2; + c = floor((_border_rect.size.width - titleSize.width) / 2); if (c < 0) c = 0; _title_rect.origin.x = _border_rect.origin.x + c; _title_rect.origin.y @@ -882,7 +882,7 @@ r.size.height -= (titleSize.height / 2) + borderSize.height; */ // center the title cell - c = (_border_rect.size.width - titleSize.width) / 2; + c = floor((_border_rect.size.width - titleSize.width) / 2); if (c < 0) c = 0; _title_rect.origin.x = c; _title_rect.origin.y = 0; @@ -916,7 +916,7 @@ - (2 * borderSize.height); // center the title cell - c = (_border_rect.size.width - titleSize.width) / 2; + c = floor((_border_rect.size.width - titleSize.width) / 2); if (c < 0) c = 0; _title_rect.origin.x = c; _title_rect.origin.y = 0; @@ -951,7 +951,7 @@ r.size.height -= titleSize.height + borderSize.height; // center the title cell - c = (_border_rect.size.width - titleSize.width) / 2; + c = floor((_border_rect.size.width - titleSize.width) / 2); if (c < 0) c = 0; _title_rect.origin.x = _border_rect.origin.x + c; _title_rect.origin.y = _border_rect.origin.y + borderSize.height;