| Class | Joyau::Line |
| In: |
Drawable.cpp
|
| Parent: | Joyau::Shape |
Returns the line’s second point.
/*
Returns the line's second point.
*/
VALUE Line_getPoint(VALUE self)
{
Line &ref = getRef<Line>(self);
Point point = ref.getPoint();
return createObject(getClass("Point"), point);
}
Sets the line’s second point (the first one is set with Drawable#setPos).
/*
call-seq: point=(p)
Sets the line's second point (the first one is set with Drawable#setPos).
*/
VALUE Line_setPointPoint(VALUE self, VALUE p)
{
if (!rb_obj_is_kind_of(p, getClass("Point")))
rb_raise(rb_eTypeError, "Can't convert %s into Joyau::Point",
rb_obj_classname(p));
Line &ref = getRef<Line>(self);
Point &point = getRef<Point>(p);
ref.setPoint(point);
return p;
}
Sets the line’s second point (the first one is set with Drawable#setPos).
/*
call-seq: setPoint(x, y)
Sets the line's second point (the first one is set with Drawable#setPos).
*/
VALUE Line_setPoint(VALUE self, VALUE x, VALUE y)
{
Line &ref = getRef<Line>(self);
int _x = FIX2INT(x);
int _y = FIX2INT(y);
ref.setPoint(_x, _y);
return Qnil;
}