Guest User

Untitled

a guest
Apr 15th, 2021
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. #Piece of code that crashed
  2. for @!corner_points -> $pt {
  3. push @all_points,$pt;
  4. if $pt.hasflag('RECTANGLE') {
  5. my Point $rect = $pt.rect;
  6. push @all_points, $rect;
  7. next unless $rect.hasflag('MIS');
  8. for %vmis_pts.keys -> $k {
  9. my $match = $k.match(/^ \d+ '_' (\d+) '-' \d+ '_' (\d+) $/);
  10. if $match {
  11. my Str ($y1,$y2) = ($match)>>.Str;
  12. if $rect.y > $y1.Str and $rect.y < $y2.Str {
  13. %vmis_pts{$rect.x.Str ~ '_' ~ $rect.y.Str} = 1;
  14. }
  15. }
  16. }
  17. }
  18. }
  19.  
  20.  
  21. #Piece of code the solved the problem
  22. my @toadd;
  23. for @!corner_points -> $pt {
  24. push @all_points,$pt;
  25. if $pt.hasflag('RECTANGLE') {
  26. my Point $rect = $pt.rect;
  27. push @all_points, $rect;
  28. next unless $rect.hasflag('MIS');
  29. for %vmis_pts.keys -> $k {
  30. my $match = $k.match(/^ \d+ '_' (\d+) '-' \d+ '_' (\d+) $/);
  31. if $match {
  32. my Str ($y1,$y2) = ($match)>>.Str;
  33. if $rect.y > $y1.Str and $rect.y < $y2.Str {
  34. push @toadd, $rect.x.Str ~ '_' ~ $rect.y.Str;
  35. }
  36. }
  37. }
  38. }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment