Hi Carlos,

not realy a good plan, but maybe it helps nevertheless.

On Monday 01 May 2006 21:50, Carlos Nieves Ónega wrote:
> The problem is in x_event.nw near line 792. If I do a:
> else if (w_current->event_state == ENDMOVE) {
           ENDCOPY is a good canditate for rotating too.
>        o_drawbounding(w_current, NULL,
>                       w_current->page_current->selection2_head->next,
>                       x_get_darkcolor(w_current->bb_color), TRUE);
>        o_rotate_90(w_current,
> w_current->page_current->selection2_head->next,
>                    fix_x(w_current, mouse_x),
>                    fix_y(w_current, mouse_y));

w_current->page_current->selection2_head->next,
                    fix_x(w_current, w_current->start_x),
                    fix_y(w_current, w_current->start_y));

As the selection is still at (w_current->start_x, w_current->start_y) I 
think its better to rotate around that point. The selection is still at 
(start_x, start_y). The next mouse-motion event will put it back to the 
mouse cursor.

Manipulating start_x, start_y may be an option, too. I have no idea how.

The rotate comand erases (the not exising) original buffer and redraws 
it as selection at the screen. Thats the garbage. Let's delete it.

        o_erase_selected(w_current);

But I think this will leed to problems when rotating in ENDCOPY state.
The ENDCOPY will cause additional headache. When rotating we're rotating 
the original buffer too. =:-(

>        o_drawbounding(w_current, NULL,
>                       w_current->page_current->selection2_head->next,
>                       x_get_darkcolor(w_current->bb_color), TRUE);
>         return(0);
>       }
> Then I get some garbage in the screen, and the rotation is not done
> correctly, because the object coordinates have not been updated while
> moving the mouse in the screen (the o_rotate_90 function calculates
> the rotation of the objects like they were at the beginning of the
> move command).

> I confirmed it and got it more or less working with:
> else if (w_current->event_state == ENDMOVE) {
>        o_move_end(w_current);
>        o_rotate_90(w_current,
> w_current->page_current->selection2_head->next,
>                    fix_x(w_current, mouse_x),
>                    fix_y(w_current, mouse_y));
>        o_move_start(w_current, fix_x(w_current, mouse_x),
>                     fix_y(w_current, mouse_y));
>        w_current->event_state = ENDMOVE;
>         return(0);
>       }
>
> Now the rotation is done correctly, but I can see some grips drawing
> and erasing, and I think that maybe there is a simple solution. Can
> someone give me a clue?

Sorry not a good one.

Regards
Werner

Reply via email to