MCPcopy Create free account
hub / github.com/axmolengine/axmol / parseCapInset

Method parseCapInset

core/base/NinePatchImageParser.cpp:153–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153Rect 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
174void NinePatchImageParser::setSpriteFrameInfo(Image* image, const ax::Rect& frameRect, bool rotated)
175{

Callers 3

parseNinePatchImageMethod · 0.80

Calls 3

parseHorizontalMarginMethod · 0.95
parseVerticalMarginMethod · 0.95
RectFunction · 0.50

Tested by 1