mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
* GormCore/GormGenericEditor.m: Reformed and applied patch provided
by Sergey Golovin. Corrects bug#17539. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@25852 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3d05090894
commit
3b0658b1e9
2 changed files with 23 additions and 13 deletions
|
@ -1,3 +1,8 @@
|
|||
2008-01-03 20:39-EST Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormCore/GormGenericEditor.m: Reformed and applied patch provided
|
||||
by Sergey Golovin. Corrects bug#17539.
|
||||
|
||||
2008-01-03 20:17-EST Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* English.lproj/Gorm.gorm: Added menu shortcut for delete/backspace
|
||||
|
|
|
@ -257,23 +257,28 @@
|
|||
unsigned count = [objects count];
|
||||
unsigned index = 0;
|
||||
int cols = 0;
|
||||
int rows = 0;
|
||||
int rows = 0;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
int square = 0;
|
||||
|
||||
width = [[self superview] bounds].size.width;
|
||||
while (width >= 72)
|
||||
cols = width / [self cellSize].width;
|
||||
height = [[self superview] bounds].size.height;
|
||||
rows = height / [self cellSize].height;
|
||||
square = height * width;
|
||||
while(rows * cols <= count)
|
||||
{
|
||||
width -= (72 + 8);
|
||||
cols++;
|
||||
}
|
||||
if (cols == 0)
|
||||
{
|
||||
cols = 1;
|
||||
}
|
||||
rows = count / cols;
|
||||
if (rows == 0 || rows * cols != count)
|
||||
{
|
||||
rows++;
|
||||
int vdiff = square - height * cols * [self cellSize].width;
|
||||
int hdiff = square - width * rows * [self cellSize].height;
|
||||
if( vdiff > hdiff)
|
||||
{
|
||||
cols++;
|
||||
}
|
||||
else
|
||||
{
|
||||
rows++;
|
||||
}
|
||||
}
|
||||
[self renewRows: rows columns: cols];
|
||||
|
||||
|
|
Loading…
Reference in a new issue