[AD] [ alleg-Bugs-2954853 ] don't clip sub-bitmap coordinates

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Bugs item #2954853, was opened at 2010-02-19 09:44
Message generated for change (Comment added) made by elias
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=2954853&group_id=5665

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core Library
Group: 4.9
Status: Open
>Resolution: Fixed
Priority: 1
Private: No
Submitted By: Elias Pschernig (elias)
Assigned to: Nobody/Anonymous (nobody)
Summary: don't clip sub-bitmap coordinates

Initial Comment:
Right now those two lines are strictly equivalent:

al_create_sub_bitmap(-10, -10, 100, 100);
al_create_sub_bitmap(0, 0, 90, 90);

This means that code like this will fail:

myfunc(x, y) {
    sub = al_create_sub_bitmap(x, y, 10, 10);
    al_set_target_bitmap(sub);
    draw_something_inside(0, 0, 10, 10);
}

Whenever x/y are >= 0, drawing into the 10x10 sub bitmap will use the right position. However as soon as x/y are < 0, the offset will start to go wrong.

The problem was originally reported here: https://sourceforge.net/mailarchive/message.php?msg_id=9563d6b60908072022u292e929ayb4dae0cd8f2d78d4%40mail.gmail.com

To quote Matthew Leverton from that thread: "The current behavior of clipping the top/left part of a sub-bitmap and
shifting its origin makes no sense and is useless, in my opinion."

While there was no agreement on most of the other things in that thread we probably want to fix at least this issue.

----------------------------------------------------------------------

>Comment By: Elias Pschernig (elias)
Date: 2010-08-14 14:31

Message:
Should be fixed now.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=2954853&group_id=5665




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/