diff options
| author | Jasper St. Pierre <jstpierre@mecheye.net> | 2023-10-11 21:38:42 -0700 |
|---|---|---|
| committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2023-10-11 21:38:42 -0700 |
| commit | dba5833011697f7c320a0c7be3ae816ef6bbf131 (patch) | |
| tree | 600605e62d48bf99aab762396273a41ed9bfef0a /src/JSystem/J2DGraph/J2DPane.cpp | |
| parent | 2a98b09d1aaabdc27a79a2e9af23d39d6cdce386 (diff) | |
J2DPane match
Diffstat (limited to 'src/JSystem/J2DGraph/J2DPane.cpp')
| -rw-r--r-- | src/JSystem/J2DGraph/J2DPane.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/JSystem/J2DGraph/J2DPane.cpp b/src/JSystem/J2DGraph/J2DPane.cpp index 2acde8d2..4dfdb177 100644 --- a/src/JSystem/J2DGraph/J2DPane.cpp +++ b/src/JSystem/J2DGraph/J2DPane.cpp @@ -162,11 +162,13 @@ void J2DPane::draw(float x, float y, const J2DGrafContext* pCtx, bool clip) { mDrawBounds = mBounds; if (pParentPane != NULL) { - mScreenBounds.addPos(pParentPane->mScreenBounds.i.x, pParentPane->mScreenBounds.i.y); + JGeometry::TBox2<f32> screenBounds = pParentPane->mScreenBounds; + mScreenBounds.addPos(screenBounds.i.x, screenBounds.i.y); MTXConcat(pParentPane->mDrawMtx, mMtx, mDrawMtx); if (clip) { - mDrawBounds.addPos(pParentPane->mScreenBounds.i.x, pParentPane->mScreenBounds.i.y); + JGeometry::TBox2<f32> screenBounds = pParentPane->mScreenBounds; + mDrawBounds.addPos(screenBounds.i.x, screenBounds.i.y); mDrawBounds.intersect(pParentPane->mDrawBounds); } @@ -181,7 +183,7 @@ void J2DPane::draw(float x, float y, const J2DGrafContext* pCtx, bool clip) { mDrawAlpha = mAlpha; } - JGeometry::TBox2<f32> clipBounds( 0.0f, 0.0f, 0.0f, 0.0f ); + JGeometry::TBox2<f32> clipBounds(0.0f, 0.0f, 0.0f, 0.0f); if (clip) ((J2DOrthoGraph*)pCtx)->scissorBounds(&clipBounds, &mDrawBounds); @@ -194,7 +196,7 @@ void J2DPane::draw(float x, float y, const J2DGrafContext* pCtx, bool clip) { GXSetCullMode((GXCullMode)mCullMode); drawSelf(x, y, &ctx.mPosMtx); - for (JSUTreeIterator<J2DPane> iter = mPaneTree.getFirstChild(); iter.getObject(); ++iter) + for (JSUTreeIterator<J2DPane> iter = mPaneTree.getFirstChild(); iter; ++iter) iter->draw(0.0f, 0.0f, pCtx, clip); } } @@ -243,7 +245,7 @@ void J2DPane::makeMatrix(f32 x, f32 y) { if (mRotation != 0.0f) { MTXTrans(stack1, -mBasePosition.x, -mBasePosition.y, 0.0f); f32 rot = mRotationAxis == ROTATE_Z ? -mRotation : mRotation; - MTXRotRad(stack2, mRotationAxis, rot * 0.017445329f); + MTXRotRad(stack2, mRotationAxis, rot * 0.017453292f); MTXTrans(stack3, mBasePosition.x + x, mBasePosition.y + y, 0.0f); MTXConcat(stack2, stack1, mMtx); MTXConcat(stack3, mMtx, mMtx); |
