void KstBindLine::setTo(KJS::ExecState *exec, const KJS::Value& value) { KstBindPoint *imp = 0L; if (value.type() != KJS::ObjectType || !(imp = dynamic_cast<KstBindPoint*>(value.toObject(exec).imp()))) { return createPropertyTypeError(exec); } KstViewLinePtr d = makeLine(_d); if (d) { KstWriteLocker wl(d); d->setTo(QPoint(int(imp->_x), int(imp->_y))); KstApp::inst()->paintAll(KstPainter::P_PAINT); } }
void KstBindLine::setTo(KJS::ExecState *exec, const KJS::Value& value) { KstBindPoint *imp = 0L; if (value.type() != KJS::ObjectType || !(imp = dynamic_cast<KstBindPoint*>(value.toObject(exec).imp()))) { KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError); exec->setException(eobj); return; } KstViewLinePtr d = makeLine(_d); if (d) { KstWriteLocker wl(d); d->setTo(QPoint(int(imp->_x), int(imp->_y))); // FIXME: Point is the wrong // type to use here. It's // a double, for one... KstApp::inst()->paintAll(KstPainter::P_PAINT); } }