diff options
Diffstat (limited to 'Swiften')
4 files changed, 7 insertions, 33 deletions
diff --git a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp index 5d4aef1..7581115 100644 --- a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp +++ b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp @@ -52,21 +52,15 @@ namespace Swift { int y1 = 0; int x2 = 0; int y2 = 0; - int xShift = 0; - int yShift = 0; try { x1 = boost::lexical_cast<int>(attributes.getAttributeValue("x1").get_value_or("0")); y1 = boost::lexical_cast<int>(attributes.getAttributeValue("y1").get_value_or("0")); x2 = boost::lexical_cast<int>(attributes.getAttributeValue("x2").get_value_or("0")); y2 = boost::lexical_cast<int>(attributes.getAttributeValue("y2").get_value_or("0")); - xShift = boost::lexical_cast<int>(attributes.getAttributeValue("xshift").get_value_or("0")); - yShift = boost::lexical_cast<int>(attributes.getAttributeValue("yshift").get_value_or("0")); } catch (boost::bad_lexical_cast&) { } WhiteboardLineElement::ref whiteboardElement = boost::make_shared<WhiteboardLineElement>(x1, y1, x2, y2); - whiteboardElement->setShift(xShift, yShift); - Color color(attributes.getAttributeValue("stroke").get_value_or("#000000")); color.setAlpha(opacityToAlpha(attributes.getAttributeValue("opacity").get_value_or("1"))); whiteboardElement->setColor(color); diff --git a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp index 965939a..d22d4ce 100644 --- a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp @@ -20,8 +20,6 @@ namespace Swift { element->setAttribute("y1", boost::lexical_cast<std::string>(line.y1())); element->setAttribute("x2", boost::lexical_cast<std::string>(line.x2())); element->setAttribute("y2", boost::lexical_cast<std::string>(line.y2())); - element->setAttribute("xshift", boost::lexical_cast<std::string>(line.getXShift())); - element->setAttribute("yshift", boost::lexical_cast<std::string>(line.getYShift())); element->setAttribute("id", line.getID()); element->setAttribute("stroke", line.getColor().toHex()); element->setAttribute("stroke-width", boost::lexical_cast<std::string>(line.getPenWidth())); diff --git a/Swiften/Whiteboard/Elements/WhiteboardLineElement.h b/Swiften/Whiteboard/Elements/WhiteboardLineElement.h index 85e6302..20455b6 100644 --- a/Swiften/Whiteboard/Elements/WhiteboardLineElement.h +++ b/Swiften/Whiteboard/Elements/WhiteboardLineElement.h @@ -37,19 +37,6 @@ namespace Swift { return y2_; } - int getXShift() const { - return xShift_; - } - - int getYShift() const { - return yShift_; - } - - void setShift(int x, int y) { - xShift_ = x; - yShift_ = y; - } - const Color& getColor() const { return color_; } @@ -80,7 +67,6 @@ namespace Swift { private: int x1_, y1_, x2_, y2_; - int xShift_, yShift_; Color color_; int penWidth_; std::string id_; diff --git a/Swiften/Whiteboard/IncomingWhiteboardSession.cpp b/Swiften/Whiteboard/IncomingWhiteboardSession.cpp index 42f5934..568bed8 100644 --- a/Swiften/Whiteboard/IncomingWhiteboardSession.cpp +++ b/Swiften/Whiteboard/IncomingWhiteboardSession.cpp @@ -27,17 +27,13 @@ namespace Swift { void IncomingWhiteboardSession::handleIncomingOperation(WhiteboardOperation::ref operation) { // std::cout << "incoming pos: " << operation->getPos() << std::endl; // WhiteboardInsertOperation::ref insertOp = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(operation); -// if (insertOp) { - WhiteboardOperation::ref op = server.handleClientOperationReceived(operation); - //std::cout << "in1: " << operation->getID() << " " << operation->getPos() << " " << operation->getParentID() << std::endl; - //std::cout << "in2: " << op->getID() << " " << op->getPos() << " " << op->getParentID() << std::endl; - onOperationReceived(op); - WhiteboardPayload::ref payload = boost::make_shared<WhiteboardPayload>(); - payload->setOperation(op); - sendPayload(payload); -// } else { -// std::cout << "unknown operation" << std::endl; -// } + WhiteboardOperation::ref op = server.handleClientOperationReceived(operation); + //std::cout << "in1: " << operation->getID() << " " << operation->getPos() << " " << operation->getParentID() << std::endl; + //std::cout << "in2: " << op->getID() << " " << op->getPos() << " " << op->getParentID() << std::endl; + onOperationReceived(op); + WhiteboardPayload::ref payload = boost::make_shared<WhiteboardPayload>(); + payload->setOperation(op); + sendPayload(payload); } void IncomingWhiteboardSession::sendOperation(WhiteboardOperation::ref operation) { |