Changeset 8202 for branches

Show
Ignore:
Timestamp:
05/11/11 15:57:36 (7 months ago)
Author:
westram
Message:
  • world_to_win_coords / win_to_world_coords
    • aligned to each other
    • fix a "bug" in win_to_world_coords
      • comparison in loop-condition now against window_pos (not world_pos)
        • no difference on first folding-line in each direction
        • the only "non-first" folding line is the bottom-line
      • no idea if that "bug" had any effect, didnt find any
Location:
branches/e4fix/EDIT4
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/e4fix/EDIT4/ED4_root.cxx

    r8201 r8202  
    104104 
    105105 
    106 void ED4_window::win_to_world_coords(AW_pos *x, AW_pos *y) { 
     106void ED4_window::win_to_world_coords(AW_pos *xPtr, AW_pos *yPtr) { 
    107107    // calculates transformation from window to world coordinates in a given window 
    108     AW_pos temp_x = *x; 
    109     AW_pos temp_y = *y; 
     108    const AW_pos x = *xPtr; 
     109    const AW_pos y = *yPtr; 
     110 
     111    AW_pos temp_x = x; 
     112    AW_pos temp_y = y; 
    110113 
    111114    ED4_folding_line *current_fl = vertical_fl;                            // calculate x-offset due to vertical folding lines 
    112     while ((current_fl != NULL) && (*x >= current_fl->world_pos[X_POS])) 
    113     { 
     115    while ((current_fl != NULL) && (x >= current_fl->window_pos[X_POS])) { 
    114116        if ((current_fl->length == INFINITE) || 
    115             ((*y >= current_fl->window_pos[Y_POS]) && (*y <= (current_fl->window_pos[Y_POS] + current_fl->length)))) 
     117            ((y >= current_fl->window_pos[Y_POS]) && (y <= (current_fl->window_pos[Y_POS] + current_fl->length)))) 
    116118        { 
    117119            temp_x += current_fl->dimension; 
     
    121123 
    122124    current_fl = horizontal_fl;                         // calculate y-offset due to horizontal folding lines 
    123     while ((current_fl != NULL) && (*y >= current_fl->world_pos[Y_POS])) { 
     125    while ((current_fl != NULL) && (y >= current_fl->window_pos[Y_POS])) { 
    124126        if ((current_fl->length == INFINITE) || 
    125             ((*x >= current_fl->window_pos[X_POS]) && (*x <= (current_fl->window_pos[X_POS] + current_fl->length)))) 
     127            ((x >= current_fl->window_pos[X_POS]) && (x <= (current_fl->window_pos[X_POS] + current_fl->length)))) 
    126128        { 
    127129            temp_y += current_fl->dimension; 
     
    130132    } 
    131133 
    132     *x = temp_x; 
    133     *y = temp_y; 
     134    *xPtr = temp_x; 
     135    *yPtr = temp_y; 
    134136} 
    135137 
    136138void ED4_window::world_to_win_coords(AW_pos *xPtr, AW_pos *yPtr) { 
    137139    // calculates transformation from world to window coordinates in a given window 
    138     AW_pos x = *xPtr; 
    139     AW_pos y = *yPtr; 
     140    const AW_pos x = *xPtr; 
     141    const AW_pos y = *yPtr; 
    140142 
    141143    AW_pos temp_x = x; 
     
    145147    while (current_fl && (x>=current_fl->world_pos[X_POS])) { 
    146148        if ((current_fl->length == INFINITE) || 
    147             ((y >= current_fl->world_pos[Y_POS]) && 
    148              (y <= current_fl->world_pos[Y_POS] + current_fl->length))) 
     149            ((y >= current_fl->world_pos[Y_POS]) && (y <= current_fl->world_pos[Y_POS] + current_fl->length))) 
    149150        { 
    150151            temp_x -= current_fl->dimension; 
     
    156157    while (current_fl && (y >= current_fl->world_pos[Y_POS])) { 
    157158        if ((current_fl->length == INFINITE) || 
    158             ((x >= current_fl->world_pos[X_POS]) && 
    159              (x <= (current_fl->world_pos[X_POS] + current_fl->length)))) 
     159            ((x >= current_fl->world_pos[X_POS]) && (x <= (current_fl->world_pos[X_POS] + current_fl->length)))) 
    160160        { 
    161161            temp_y -= current_fl->dimension; 
  • branches/e4fix/EDIT4/ed4_class.hxx

    r8201 r8202  
    291291    AW_pos            window_pos[2]; 
    292292    AW_pos            length; 
    293     AW_pos            dimension; 
     293    AW_pos            dimension; // amount of pixel folded away 
    294294    ED4_base         *link; 
    295295    ED4_folding_line *next; 
    296296 
    297297    ED4_folding_line(); 
     298 
     299     
    298300}; 
    299301