/***************************************************************************
 *   Copyright (C) 2004-2005 by                                            *
 *     Paolo Sacconier   <axa1981@tin.it>                                  *
 *     Francesco Tamagni <minchiahead@hacari.org>                          *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#include "rect.h"

namespace gillo {

Rect::Rect() {
}

Rect::~Rect() {
}

void Rect::setCoords(float x1, float y1, float x2, float y2) {
    coords[0][0] = x1;
    coords[0][1] = y1;
    coords[1][0] = x2;
    coords[1][1] = y1;
    coords[2][0] = x2;
    coords[2][1] = y2;
    coords[3][0] = x1;
    coords[3][1] = y2;
}

void Rect::setCoords(float c[4]) {
	this->setCoords(c[0], c[1], c[2], c[3]);
}

void Rect::setPos(float x, float y) {
	setCoords(x, y, x+this->getWidth(), y+this->getHeight());
}
		
void Rect::traslate(float dx, float dy) {
    coords[0][0] += dx;
    coords[0][1] += dy;
    coords[1][0] += dx;
    coords[1][1] += dy;
    coords[2][0] += dx;
    coords[2][1] += dy;
    coords[3][0] += dx;
    coords[3][1] += dy;
}

}
