From c7a061dff422daea8861b588358621d563540b40 Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Sun, 27 Jan 2013 14:51:26 +0000 Subject: [PATCH] * Source/NSTextContainer.m (lineFragmentRectForProposedRect:...): Prevent negative width/height from being returned. Bug found by unit test from Nikolaus Schaller . git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36026 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSTextContainer.m | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 127f83438..5a1d084a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-01-27 Fred Kiefer + + * Source/NSTextContainer.m (lineFragmentRectForProposedRect:...): + Prevent negative width/height from being returned. + Bug found by unit test from Nikolaus Schaller . + 2013-01-25 12:58-EST Gregory John Casamento * Source/NSPopUpButtonCell.m: Revert previous change. diff --git a/Source/NSTextContainer.m b/Source/NSTextContainer.m index b21d788f2..90f16e73d 100644 --- a/Source/NSTextContainer.m +++ b/Source/NSTextContainer.m @@ -448,7 +448,9 @@ framework intact. return NSZeroRect; } - return NSMakeRect(minx, miny, maxx - minx, maxy - miny); + return NSMakeRect(minx, miny, + (maxx > minx) ? maxx - minx : 0.0, + (maxy > miny) ? maxy - miny : 0.0); } - (BOOL) isSimpleRectangularTextContainer