| 66 | } |
| 67 | |
| 68 | int NinePatchImageParser::getPixelOriginOffset(Direction direction) const |
| 69 | { |
| 70 | int imageWidth = _image->getWidth(); |
| 71 | int frameWidth = this->getFrameWidth(); |
| 72 | |
| 73 | int topLineLeftOffset = (int)_imageFrame.origin.y * imageWidth * 4 + (int)_imageFrame.origin.x * 4; |
| 74 | if (direction == Direction::HORIZONTAL) |
| 75 | { |
| 76 | return topLineLeftOffset; |
| 77 | } |
| 78 | else |
| 79 | { |
| 80 | if (_isRotated) |
| 81 | { |
| 82 | return topLineLeftOffset + (frameWidth - 1) * 4; |
| 83 | } |
| 84 | else |
| 85 | { |
| 86 | return topLineLeftOffset; |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | Vec2 NinePatchImageParser::parseHorizontalMargin() const |
| 92 | { |
no test coverage detected