pixel_space.dart 732 B

12345678910111213141516171819202122232425262728293031
  1. class PixelSpacing {
  2. double _physicalDeltaY = 0.0;
  3. double _physicalDeltaX = 0.0;
  4. factory PixelSpacing.fill(double physicalDeltaX, double physicalDeltaY) {
  5. return PixelSpacing()
  6. .._physicalDeltaX = physicalDeltaX
  7. .._physicalDeltaY = physicalDeltaY;
  8. }
  9. PixelSpacing();
  10. /// Delta X
  11. double get physicalDeltaX => _physicalDeltaX;
  12. set physicalDeltaX(double val) {
  13. if (val != _physicalDeltaX) {
  14. _physicalDeltaX = val;
  15. }
  16. }
  17. /// Delta Y
  18. double get physicalDeltaY => _physicalDeltaY;
  19. set physicalDeltaY(double val) {
  20. if (val != _physicalDeltaY) {
  21. _physicalDeltaY = val;
  22. }
  23. }
  24. /// 是否为空数据
  25. bool get isEmpty => _physicalDeltaX == 0 || _physicalDeltaY == 0;
  26. }