react-native-gizwits-scroll-ruler 1.0.10 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,6 +55,7 @@ public class RNScrollRuler extends View {
55
55
  * 刻度最小值
56
56
  */
57
57
  private int minScale = 0;
58
+ private int rawMinScale = 0;
58
59
  /**
59
60
  * 第一次显示的刻度
60
61
  */
@@ -63,6 +64,7 @@ public class RNScrollRuler extends View {
63
64
  * 刻度最大值
64
65
  */
65
66
  private int maxScale = 100;
67
+ private int rawMaxScale = 100;
66
68
 
67
69
  private float step = (float) 0.1;
68
70
  /**
@@ -658,6 +660,7 @@ public class RNScrollRuler extends View {
658
660
 
659
661
  public void setMinScale(int minScale) {
660
662
  this.minScale = (int)(minScale / step);
663
+ this.rawMinScale = minScale;
661
664
  invalidate();
662
665
  }
663
666
 
@@ -667,6 +670,7 @@ public class RNScrollRuler extends View {
667
670
  }
668
671
  public void setMaxScale(int maxScale) {
669
672
  this.maxScale = (int)(maxScale / step);
673
+ this.rawMaxScale = maxScale;
670
674
  invalidate();
671
675
  }
672
676
 
@@ -737,6 +741,9 @@ public class RNScrollRuler extends View {
737
741
  public void setScaleLimit(float step) {
738
742
  this.scaleLimit = (int)(step * 10);
739
743
  this.step = step;
744
+
745
+ this.setMinScale(this.rawMinScale);
746
+ this.setMaxScale(this.rawMaxScale);
740
747
  invalidate();
741
748
  }
742
749
 
@@ -550,10 +550,12 @@
550
550
  [self.unitLab setFrame:CGRectMake(halfWidth+15, 18, 40, 30)];
551
551
 
552
552
  if(self.headerView){
553
- [self.footerView setFrame:CGRectMake(0, 0, halfWidth, CollectionHeight)];
553
+ [self.headerView setFrame:CGRectMake(0, 0, halfWidth, CollectionHeight)];
554
+ [self.headerView setNeedsDisplay];
554
555
  }
555
556
  if(self.footerView){
556
557
  [self.footerView setFrame:CGRectMake(0, 0, halfWidth, CollectionHeight)];
558
+ [self.footerView setNeedsDisplay];
557
559
  }
558
560
 
559
561
  CGFloat x = halfWidth-self.triangle.frame.size.width/2;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-gizwits-scroll-ruler",
3
- "version": "1.0.10",
4
- "description": "ReactNative版选择身高体重的横向刻度尺组件,兼容Android和iOS",
3
+ "version": "1.0.13",
4
+ "description": "修复安卓 step更新 没有更新min max的问题",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"