| 151 | } |
| 152 | |
| 153 | Rect NinePatchImageParser::parseCapInset() const |
| 154 | { |
| 155 | Rect capInsets; |
| 156 | Vec2 horizontalLine = this->parseHorizontalMargin(); |
| 157 | Vec2 verticalLine = this->parseVerticalMargin(); |
| 158 | |
| 159 | if (_isRotated) |
| 160 | { |
| 161 | capInsets = Rect(verticalLine.y, _imageFrame.size.height - horizontalLine.y, verticalLine.y - verticalLine.x, |
| 162 | horizontalLine.y - horizontalLine.x); |
| 163 | } |
| 164 | else |
| 165 | { |
| 166 | capInsets = Rect(horizontalLine.x, verticalLine.x, horizontalLine.y - horizontalLine.x, |
| 167 | verticalLine.y - verticalLine.x); |
| 168 | } |
| 169 | |
| 170 | capInsets = AX_RECT_PIXELS_TO_POINTS(capInsets); |
| 171 | return capInsets; |
| 172 | } |
| 173 | |
| 174 | void NinePatchImageParser::setSpriteFrameInfo(Image* image, const ax::Rect& frameRect, bool rotated) |
| 175 | { |