File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
library/src/main/java/io/syslogic/colorpicker Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -60,12 +60,8 @@ public void setColorFilter(@Nullable ColorFilter cf) {
60
60
@ Override
61
61
protected void onBoundsChange (@ NonNull Rect bounds ) {
62
62
super .onBoundsChange (bounds );
63
- int height = bounds .height ();
64
- int width = bounds .width ();
65
- //noinspection IntegerDivisionInFloatingPointContext
66
- numRectanglesHorizontal = (int ) Math .ceil (width / mRectangleSize );
67
- //noinspection IntegerDivisionInFloatingPointContext
68
- numRectanglesVertical = (int ) Math .ceil (height / mRectangleSize );
63
+ numRectanglesHorizontal = bounds .width () / mRectangleSize ;
64
+ numRectanglesVertical = bounds .height () / mRectangleSize ;
69
65
generatePatternBitmap ();
70
66
}
71
67
Original file line number Diff line number Diff line change 27
27
28
28
/**
29
29
* The Color-Picker {@link View} (refactored version).
30
- *
31
30
* It displays a color picker to the user and allow them to select a color.
32
31
* the slider for the alpha-channel can be enabled setAlphaSliderVisible(true).
33
32
*
@@ -190,7 +189,7 @@ private int[] getHueColors() {
190
189
}
191
190
192
191
@ Override
193
- protected void onDraw (Canvas canvas ) {
192
+ protected void onDraw (@ NonNull Canvas canvas ) {
194
193
if (mDrawingRect .width () <= 0 || mDrawingRect .height () <= 0 ) {
195
194
return ;
196
195
}
You can’t perform that action at this time.
0 commit comments