| 262 | } |
| 263 | |
| 264 | void J2DPane::draw(f32 x, f32 y, const J2DGrafContext* grafContext, bool isOrthoGraf, bool check) |
| 265 | { |
| 266 | bool unkBool = check && mIsVisible; |
| 267 | if (grafContext->getGrafType() != J2DGraf_Ortho) { |
| 268 | isOrthoGraf = false; |
| 269 | } |
| 270 | |
| 271 | JSUTree<J2DPane>* parentTree = mTree.getParent(); |
| 272 | J2DPane* parent = nullptr; |
| 273 | if (parentTree) { |
| 274 | parent = parentTree->getObject(); |
| 275 | } |
| 276 | |
| 277 | if (mBounds.isValid()) { |
| 278 | mGlobalBounds = mBounds; |
| 279 | |
| 280 | mGlobalBounds.addPos(mOffset.x, mOffset.y); |
| 281 | |
| 282 | if (unkBool) { |
| 283 | mClipRect = mBounds; |
| 284 | rewriteAlpha(); |
| 285 | } |
| 286 | |
| 287 | if (parent) { |
| 288 | f32 width = parent->mGlobalBounds.i.x - parent->mBounds.i.x; |
| 289 | f32 height = parent->mGlobalBounds.i.y - parent->mBounds.i.y; |
| 290 | mGlobalBounds.addPos(width, height); |
| 291 | PSMTXConcat(parent->mGlobalMtx, mPositionMtx, mGlobalMtx); |
| 292 | |
| 293 | if (unkBool) { |
| 294 | if (isOrthoGraf) { |
| 295 | mClipRect = mGlobalBounds; |
| 296 | mClipRect.intersect(parent->mClipRect); |
| 297 | } |
| 298 | |
| 299 | mColorAlpha = mAlpha; |
| 300 | if (mIsInfluencedAlpha) { |
| 301 | mColorAlpha = (mAlpha * parent->mColorAlpha) / 255; |
| 302 | } |
| 303 | } |
| 304 | } else { |
| 305 | mGlobalBounds.addPos(x, y); |
| 306 | makeMatrix(mOffset.x + x, mOffset.y + y); |
| 307 | PSMTXCopy(mPositionMtx, mGlobalMtx); |
| 308 | mClipRect = mGlobalBounds; |
| 309 | mColorAlpha = mAlpha; |
| 310 | } |
| 311 | |
| 312 | JGeometry::TBox2f scissorBounds(0.0f, 0.0f, 0.0f, 0.0f); |
| 313 | if (unkBool && isOrthoGraf) { |
| 314 | ((J2DOrthoGraph*)grafContext)->scissorBounds(&scissorBounds, &mClipRect); |
| 315 | } |
| 316 | |
| 317 | if (unkBool && (mClipRect.isValid() || !isOrthoGraf)) { |
| 318 | J2DGrafContext tmpGraf = *grafContext; |
| 319 | if (isOrthoGraf) { |
| 320 | tmpGraf.scissor(scissorBounds); |
| 321 | tmpGraf.setScissor(); |
no test coverage detected