[Fix] Mouse events not taking into account custom window offset.

This commit is contained in:
Allanis 2013-03-10 14:25:00 +00:00
parent 1d6b0268b5
commit 43a1bb019f
2 changed files with 3 additions and 4 deletions

View File

@ -98,8 +98,8 @@ int areAllies(Faction* a, Faction* b) {
static Faction* faction_parse(xmlNodePtr parent) {
Faction* tmp = CALLOC_L(Faction);
tmp->name = (char*)xmlGetProp(parent, (xmlChar*)"name");
if(tmp->name == NULL) WARN("Faction from "FACTION_DATA"
has invalid or no name");
if(tmp->name == NULL)
WARN("Faction from "FACTION_DATA" has invalid or no name");
return tmp;
}
@ -142,7 +142,6 @@ static void alliance_parse(xmlNodePtr parent) {
// Set the crap needed by faction_stack.
for(j = 0; j < (*i); j++) {
a->factions[j]->nallies += (*i)-1;
static void map_render(double bx, double by, double w, double h);
a->factions[j]->allies = realloc(a->factions[j]->allies,
a->factions[j]->nallies*sizeof(Faction*));
for(n = 0, m = 0; n < (*i); n++, m++) {

View File

@ -912,7 +912,7 @@ static void toolkit_mouseEvent(SDL_Event* event) {
if((x > wgt->x) && (x < (wgt->x + wgt->w)) &&
(y > wgt->y) && (y < (wgt->y + wgt->h))) {
if((wgt->type == WIDGET_CUST) && wgt->dat.cst.mouse)
(*wgt->dat.cst.mouse)(event->type, x, y);
(*wgt->dat.cst.mouse)(event->type, x-wgt->x, y-wgt->y);
else
switch(event->type) {
case SDL_MOUSEMOTION: