diff --git a/src/gui/drawables/scaledrawable.cc b/src/gui/drawables/scaledrawable.cc index 69ee7a48..1151d71d 100755 --- a/src/gui/drawables/scaledrawable.cc +++ b/src/gui/drawables/scaledrawable.cc @@ -30,7 +30,7 @@ ScaleDrawable::ScaleDrawable(std::shared_ptr state):DrawableWrapper( mState = state; } -ScaleDrawable::ScaleDrawable(Drawable* drawable, int gravity,int scaleWidth,int scaleHeight) +ScaleDrawable::ScaleDrawable(Drawable* drawable, int gravity,float scaleWidth,float scaleHeight) :ScaleDrawable(std::make_shared()){ mState->mGravity = gravity; mState->mScaleWidth = scaleWidth; @@ -62,13 +62,13 @@ void ScaleDrawable::onBoundsChange(const Rect& bounds){ const int level = getLevel(); int w = bounds.width; - if (mState->mScaleWidth > 0) { + if (mState->mScaleWidth > 0.f) { const int iw = min ? d->getIntrinsicWidth() : 0; w -= (int) ((w - iw) * (MAX_LEVEL - level) * mState->mScaleWidth / MAX_LEVEL); } int h = bounds.height; - if (mState->mScaleHeight > 0) { + if (mState->mScaleHeight > 0.f) { const int ih = min ? d->getIntrinsicHeight() : 0; h -= (int) ((h - ih) * (MAX_LEVEL - level) * mState->mScaleHeight / MAX_LEVEL); } diff --git a/src/gui/drawables/scaledrawable.h b/src/gui/drawables/scaledrawable.h index 6ee56032..b4b5cd07 100755 --- a/src/gui/drawables/scaledrawable.h +++ b/src/gui/drawables/scaledrawable.h @@ -7,8 +7,8 @@ class ScaleDrawable:public DrawableWrapper{ private: class ScaleState:public DrawableWrapperState{ public: - int mScaleWidth; - int mScaleHeight; + float mScaleWidth; + float mScaleHeight; int mGravity; int mInitialLevel; bool mUseIntrinsicSizeAsMin; @@ -23,7 +23,7 @@ protected: bool onLevelChange(int level)override; std::shared_ptr mutateConstantState()override; public: - ScaleDrawable(Drawable* drawable, int gravity,int scaleWidth,int scaleHeight); + ScaleDrawable(Drawable* drawable, int gravity,float scaleWidth,float scaleHeight); std::shared_ptrgetConstantState()override; void draw(Canvas& canvas); int getOpacity()override; diff --git a/src/gui/view/gravity.cc b/src/gui/view/gravity.cc index 5d903395..80c0d714 100755 --- a/src/gui/view/gravity.cc +++ b/src/gui/view/gravity.cc @@ -11,7 +11,7 @@ void Gravity::apply(int gravity, int w, int h,const RECT& container,RECT& outRec } void Gravity::apply(int gravity, int w, int h,const RECT& container,RECT& outRect, int layoutDirection){ - int absGravity = getAbsoluteGravity(gravity, layoutDirection); + const int absGravity = getAbsoluteGravity(gravity, layoutDirection); apply(absGravity, w, h, container, 0, 0, outRect); } @@ -63,7 +63,7 @@ void Gravity::apply(int gravity, int w, int h,const RECT& container,int xAdj, in outRect.top = container.top; } if (outRect.bottom() > container.bottom()) { - outRect.height=container.bottom()-outRect.top; + outRect.height = container.bottom() - outRect.top; } } break; @@ -72,7 +72,7 @@ void Gravity::apply(int gravity, int w, int h,const RECT& container,int xAdj, in outRect.height = h; if ((gravity&(AXIS_CLIP< container.bottom()) { - outRect.width=container.bottom()-outRect.top; + outRect.height = container.bottom() - outRect.top; } } break; diff --git a/src/gui/view/velocitytracker.cc b/src/gui/view/velocitytracker.cc index 6530dd07..4ed280bb 100755 --- a/src/gui/view/velocitytracker.cc +++ b/src/gui/view/velocitytracker.cc @@ -310,7 +310,7 @@ void VelocityTrackerImpl::addMovement(const MotionEvent& event) { } nsecs_t eventTime; - VelocityTracker::Position positions[128];//pointerCount]; + VelocityTracker::Position positions[pointerCount]; size_t historySize = event.getHistorySize(); memset(positions,0,sizeof(positions)); @@ -632,7 +632,7 @@ static bool solveLeastSquares(const float* x, const float* y, #endif // Expand the X vector to a matrix A, pre-multiplied by the weights. - float a[128][128];//[n][m]; // column-major order + float a[n][m]; // column-major order for (uint32_t h = 0; h < m; h++) { a[0][h] = w[h]; for (uint32_t i = 1; i < n; i++) { @@ -644,8 +644,8 @@ static bool solveLeastSquares(const float* x, const float* y, #endif // Apply the Gram-Schmidt process to A to obtain its QR decomposition. - float q[128][128];//[n][m]; // orthonormal basis, column-major order - float r[128][128];//[n][n]; // upper triangular matrix, row-major order + float q[n][m]; // orthonormal basis, column-major order + float r[n][n]; // upper triangular matrix, row-major order for (uint32_t j = 0; j < n; j++) { for (uint32_t h = 0; h < m; h++) { q[j][h] = a[j][h];