[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix: NSTabView, drawRect:
From: |
Georg Fleischmann |
Subject: |
Fix: NSTabView, drawRect: |
Date: |
Tue, 5 Dec 2000 19:02:40 +0100 |
Hi,
ok, here is the fix for the problem in [NSTabView drawRect:].
The problem is that the method draws to the origin of 'rect', instead of
drawing to the origin of the bounds. 'rect' should be used only to decide
whether things have to be drawn at all.
Georg
2000-12-05 Georg Fleischmann
* gui/Source/NSTabView.m ([NSTabView -drawRect:rect]):
using aRect (bounds) instead of rect to draw
*** gui/Source/NSTabView.m.old Mon Oct 23 15:38:28 2000
--- gui/Source/NSTabView.m Tue Dec 5 19:44:44 2000
***************
*** 348,374 ****
{
case NSTopTabsBezelBorder:
aRect.size.height -= 16;
- rect.size.height -= 16;
NSDrawButton(aRect, NSZeroRect);
borderThickness = 2;
break;
case NSBottomTabsBezelBorder:
! rect.size.height -= 16;
! rect.origin.y += 16;
! NSDrawButton(rect, rect);
! rect.origin.y -= 16;
borderThickness = 2;
break;
case NSNoTabsBezelBorder:
! NSDrawButton(rect, rect);
borderThickness = 2;
break;
case NSNoTabsLineBorder:
[[NSColor controlDarkShadowColor] set];
! NSFrameRect(rect);
borderThickness = 1;
break;
--- 348,373 ----
{
case NSTopTabsBezelBorder:
aRect.size.height -= 16;
NSDrawButton(aRect, NSZeroRect);
borderThickness = 2;
break;
case NSBottomTabsBezelBorder:
! aRect.size.height -= 16;
! aRect.origin.y += 16;
! NSDrawButton(aRect, aRect);
! aRect.origin.y -= 16;
borderThickness = 2;
break;
case NSNoTabsBezelBorder:
! NSDrawButton(aRect, aRect);
borderThickness = 2;
break;
case NSNoTabsLineBorder:
[[NSColor controlDarkShadowColor] set];
! NSFrameRect(aRect);
borderThickness = 1;
break;
***************
*** 404,411 ****
if (i == 0)
{
int iFlex = 0;
! iP.x = rect.origin.x;
! iP.y = rect.origin.y;
if (itemState == NSSelectedTab)
{
--- 403,410 ----
if (i == 0)
{
int iFlex = 0;
! iP.x = aRect.origin.x;
! iP.y = aRect.origin.y;
if (itemState == NSSelectedTab)
{
***************
*** 425,432 ****
else
NSLog(@"Not finished yet. Luff ya.\n");
! r.origin.x = rect.origin.x + 13;
! r.origin.y = rect.origin.y + 2;
r.size.width = s.width;
r.size.height = 15 + iFlex;
--- 424,431 ----
else
NSLog(@"Not finished yet. Luff ya.\n");
! r.origin.x = aRect.origin.x + 13;
! r.origin.y = aRect.origin.y + 2;
r.size.width = s.width;
r.size.height = 15 + iFlex;
***************
*** 446,452 ****
int iFlex = 0;
iP.x = previousRect.origin.x + previousRect.size.width;
! iP.y = rect.origin.y;
if (itemState == NSSelectedTab)
{
--- 445,451 ----
int iFlex = 0;
iP.x = previousRect.origin.x + previousRect.size.width;
! iP.y = aRect.origin.y;
if (itemState == NSSelectedTab)
{
***************
*** 482,488 ****
NSLog(@"Not finished yet. Luff ya.\n");
r.origin.x = iP.x + 13;
! r.origin.y = rect.origin.y + 2;
r.size.width = s.width;
r.size.height = 15 + iFlex; // was 15
--- 481,487 ----
NSLog(@"Not finished yet. Luff ya.\n");
r.origin.x = iP.x + 13;
! r.origin.y = aRect.origin.y + 2;
r.size.width = s.width;
r.size.height = 15 + iFlex; // was 15
***************
*** 536,543 ****
if (i == 0)
{
! iP.x = rect.origin.x;
! iP.y = rect.size.height;
if (itemState == NSSelectedTab)
{
--- 535,542 ----
if (i == 0)
{
! iP.x = aRect.origin.x;
! iP.y = aRect.size.height;
if (itemState == NSSelectedTab)
{
***************
*** 551,558 ****
else
NSLog(@"Not finished yet. Luff ya.\n");
! r.origin.x = rect.origin.x + 13;
! r.origin.y = rect.size.height;
r.size.width = s.width;
r.size.height = 15;
--- 550,557 ----
else
NSLog(@"Not finished yet. Luff ya.\n");
! r.origin.x = aRect.origin.x + 13;
! r.origin.y = aRect.size.height;
r.size.width = s.width;
r.size.height = 15;
***************
*** 570,576 ****
else
{
iP.x = previousRect.origin.x + previousRect.size.width;
! iP.y = rect.size.height;
if (itemState == NSSelectedTab)
{
--- 569,575 ----
else
{
iP.x = previousRect.origin.x + previousRect.size.width;
! iP.y = aRect.size.height;
if (itemState == NSSelectedTab)
{
***************
*** 600,606 ****
NSLog(@"Not finished yet. Luff ya.\n");
r.origin.x = iP.x + 13;
! r.origin.y = rect.size.height;
r.size.width = s.width;
r.size.height = 15;
--- 599,605 ----
NSLog(@"Not finished yet. Luff ya.\n");
r.origin.x = iP.x + 13;
! r.origin.y = aRect.size.height;
r.size.width = s.width;
r.size.height = 15;
- Fix: NSTabView, drawRect:,
Georg Fleischmann <=