* src/register/gnome/gnucash-item-edit.c (item_edit_draw_info): fix

some left-right scrolling glitches


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3996 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-04-19 10:06:33 +00:00
parent 05c143599a
commit b985ba8b04
2 changed files with 35 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2001-04-19 Dave Peticolas <dave@krondo.com>
* src/register/gnome/gnucash-item-edit.c (item_edit_draw_info): fix
some left-right scrolling glitches
* src/gnome/dialog-tax-info.c: implement tax info api
* src/gnome/account-tree.c: same as below

View File

@ -140,6 +140,7 @@ item_edit_draw_info (ItemEdit *item_edit, int x, int y, TextDrawInfo *info)
SheetBlock *block;
SheetBlockStyle *style;
GtkEditable *editable;
CellAlignment align;
Table *table;
gboolean hatching;
@ -219,7 +220,9 @@ item_edit_draw_info (ItemEdit *item_edit, int x, int y, TextDrawInfo *info)
info->text_rect.width = wd - toggle_space;
info->text_rect.height = hd - 2;
switch (gnc_table_get_align (table, item_edit->virt_loc))
align = gnc_table_get_align (table, item_edit->virt_loc);
switch (align)
{
case CELL_ALIGN_RIGHT:
xoffset = info->text_rect.width -
@ -247,6 +250,34 @@ item_edit_draw_info (ItemEdit *item_edit, int x, int y, TextDrawInfo *info)
xoffset = CELL_HPADDING - pre_cursor_width;
}
switch (align)
{
case CELL_ALIGN_RIGHT:
if (xoffset > CELL_HPADDING &&
xoffset + total_width >
info->text_rect.width - CELL_HPADDING)
xoffset = MAX (CELL_HPADDING,
(info->text_rect.width -
CELL_HPADDING) - total_width);
if (xoffset + total_width <
info->text_rect.width - CELL_HPADDING)
xoffset = (info->text_rect.width -
CELL_HPADDING) - total_width;
break;
default:
xoffset = MIN (xoffset, CELL_HPADDING);
if (xoffset < CELL_HPADDING &&
xoffset + total_width <
info->text_rect.width - CELL_HPADDING)
xoffset = MIN (CELL_HPADDING,
(info->text_rect.width -
CELL_HPADDING) - total_width);
}
info->text_x1 = dx + xoffset;
info->text_x2 = info->text_x1 + width_1;
info->text_x3 = info->text_x2 + width_2;