/** * @see SWFReader#readStraightEdgeRecord */ private void writeStraightEdgeRecord(StraightEdgeRecord shape) { tagBuffer.writeBit(true); // This is an edge. Always 1. tagBuffer.writeBit(true); // StraightFlag is always true. int numBits = shape.getNumBits(); tagBuffer.writeUB(numBits, 4); switch (shape.getLineType()) { case GENERAL: tagBuffer.writeBit(true); tagBuffer.writeSB(shape.getDeltaX(), numBits + 2); tagBuffer.writeSB(shape.getDeltaY(), numBits + 2); break; case VERTICAL: tagBuffer.writeBit(false); tagBuffer.writeBit(true); tagBuffer.writeSB(shape.getDeltaY(), numBits + 2); break; case HORIZONTAL: tagBuffer.writeBit(false); tagBuffer.writeBit(false); tagBuffer.writeSB(shape.getDeltaX(), numBits + 2); break; } }
/** * @see SWFReader#readStraightEdgeRecord */ private void writeStraightEdgeRecord(StraightEdgeRecord shape) { tagBuffer.writeBit(true); // This is an edge. Always 1. tagBuffer.writeBit(true); // StraightFlag is always true. int numBits = shape.getNumBits(); tagBuffer.writeUB(numBits, 4); switch (shape.getLineType()) { case GENERAL: tagBuffer.writeBit(true); tagBuffer.writeSB(shape.getDeltaX(), numBits + 2); tagBuffer.writeSB(shape.getDeltaY(), numBits + 2); break; case VERTICAL: tagBuffer.writeBit(false); tagBuffer.writeBit(true); tagBuffer.writeSB(shape.getDeltaY(), numBits + 2); break; case HORIZONTAL: tagBuffer.writeBit(false); tagBuffer.writeBit(false); tagBuffer.writeSB(shape.getDeltaX(), numBits + 2); break; } }