projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow ranges with left to right and bottom to top sense to be selected.
[pspp-builds.git]
/
lib
/
gtk-contrib
/
psppire-sheet.c
diff --git
a/lib/gtk-contrib/psppire-sheet.c
b/lib/gtk-contrib/psppire-sheet.c
index 8122eba99967fbef89b17c4c04363820449763e8..63307d8f51249a1a97ceae37c449f3ed24c9c789 100644
(file)
--- a/
lib/gtk-contrib/psppire-sheet.c
+++ b/
lib/gtk-contrib/psppire-sheet.c
@@
-388,29
+388,32
@@
POSSIBLE_RESIZE (const PsppireSheet *sheet, gint x, gint y,
static gboolean
static gboolean
-rectangle_from_range (PsppireSheet *sheet, const PsppireSheetRange *
input
,
+rectangle_from_range (PsppireSheet *sheet, const PsppireSheetRange *
range
,
GdkRectangle *r)
{
GdkRectangle *r)
{
- PsppireSheetRange range = *input;
+ gint col0 = MIN (range->col0, range->coli);
+ gint coli = MAX (range->col0, range->coli);
+ gint row0 = MIN (range->row0, range->rowi);
+ gint rowi = MAX (range->row0, range->rowi);
- if ( r
ange.row0 == -1 ) range.
row0 = min_visible_row (sheet);
- if ( r
ange.rowi == -1 ) range.
rowi = max_visible_row (sheet);
- if (
range.col0 == -1 ) range.
col0 = min_visible_column (sheet);
- if (
range.coli == -1 ) range.
coli = max_visible_column (sheet);
+ if ( r
ow0 == -1 )
row0 = min_visible_row (sheet);
+ if ( r
owi == -1 )
rowi = max_visible_row (sheet);
+ if (
col0 == -1 )
col0 = min_visible_column (sheet);
+ if (
coli == -1 )
coli = max_visible_column (sheet);
- r->x = psppire_axis_start_pixel (sheet->haxis,
range.
col0);
+ r->x = psppire_axis_start_pixel (sheet->haxis, col0);
r->x -= round (sheet->hadjustment->value);
r->x -= round (sheet->hadjustment->value);
- r->y = psppire_axis_start_pixel (sheet->vaxis, r
ange.r
ow0);
+ r->y = psppire_axis_start_pixel (sheet->vaxis, row0);
r->y -= round (sheet->vadjustment->value);
r->y -= round (sheet->vadjustment->value);
- r->width = psppire_axis_start_pixel (sheet->haxis,
range.
coli) -
- psppire_axis_start_pixel (sheet->haxis,
range.
col0) +
- psppire_axis_unit_size (sheet->haxis,
range.
coli);
+ r->width = psppire_axis_start_pixel (sheet->haxis, coli) -
+ psppire_axis_start_pixel (sheet->haxis, col0) +
+ psppire_axis_unit_size (sheet->haxis, coli);
- r->height = psppire_axis_start_pixel (sheet->vaxis, r
ange.r
owi) -
- psppire_axis_start_pixel (sheet->vaxis, r
ange.r
ow0) +
- psppire_axis_unit_size (sheet->vaxis, r
ange.r
owi);
+ r->height = psppire_axis_start_pixel (sheet->vaxis, rowi) -
+ psppire_axis_start_pixel (sheet->vaxis, row0) +
+ psppire_axis_unit_size (sheet->vaxis, rowi);
if ( sheet->column_titles_visible)
{
if ( sheet->column_titles_visible)
{