Closed ghost closed 8 years ago
Hi guys. @cyberbum @akopanev @Jnis Can you please help me with this?
I finally found that MDScratchImageView.fillTileWithTwoPoints:(CGPoint)begin end:(CGPoint)end has an infinite loop at while( i.x <= end.x && i.y <= end.y)
It is getting negative values, so I changed to while(i.x > 0 && i.y > 0 && i.x <= end.x && i.y <= end.y)
Now is working but I do not if it is correct.
@enrasoft Hey, hows it going for you with this patch? 1) Have you managed to get it working for iPhone 6s? 2) Have you tested it for other iPhones? 3) Are you using a device? It works just fine with the simulator so it's probably something wrong with iPhone 6s.
So far i've tested it on both iPhone 5s and iPhone 6s both with iOS 9.1 and it works perfectly with adding the patch i.x > 0 && i.y > 0. If I understand it correctly, the issue occurs because of the preciseness of the iPhone 6s screen which can and often allows this to happen: begin: (128.925620, 209.504132), end (128.925620, 209.504132) begin.x eq end.x and same for y so the while condition won't be satisfied thus i.x and i.y are decremented until memory error occurs. So this can be solved by either adding the suggested condition by @enrasoft or by removing the equality condition on (i.x <= end.x && i.y <= end.y) changing it to (i.x < end.x && i.y < end.y).
Cheers
That's it, your solution is cleaner than mine. @devdc
@enrasoft thanks
hey guys, issue fixed
@akopanev Hey, can you explain your solution please? why (i.x < end.x && i.y < end.y) won't work? thanks
@devdc , thanks for your help and support.
Hey, can you explain your solution please? why (i.x < end.x && i.y < end.y) won't work?
Target: we need mark all tiles between Begin and End points.
ex.: begin(200,200) end(100,100)
in this case: CGPoint i = begin; while(i.x < end.x && i.y < end.y){ //not reachable code ... }
So "(i.x < end.x && i.y < end.y)" does not work for fast gestures with direction to left/top
@Jnis Thanks! :)
Hello,
When you scratch and image for the first time it works perfect, but if you release your finger and try to scratch the same image again the app freeze. Im trying to solve the problem by myself but not a single error is shown in Xcode. The example project is failing too. Do you guys still work in this project? Can you please help me solving this? or can you tell me how to solve this?