diff --git a/Tetris/Assets.xcassets/TempBackground.colorset/Contents.json b/Tetris/Assets.xcassets/TempBackground.colorset/Contents.json new file mode 100644 index 0000000..4318a2c --- /dev/null +++ b/Tetris/Assets.xcassets/TempBackground.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "1.000", + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000" + } + } + }, + { + "idiom" : "universal", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0.000", + "alpha" : "1.000", + "blue" : "0.000", + "green" : "0.000" + } + } + } + ] +} \ No newline at end of file diff --git a/Tetris/ContentView.swift b/Tetris/ContentView.swift index 8090fd9..8fb1882 100644 --- a/Tetris/ContentView.swift +++ b/Tetris/ContentView.swift @@ -41,7 +41,6 @@ struct ContentView: View { .onAppear(perform: self.startTimer) .onDisappear(perform: self.stopTimer) .onTapGesture(perform: self.onTap) - .gesture(self.horizDragGesture(geometry: geometry).simultaneously(with: self.verticalDragGesture)) // .gesture(ExclusiveGesture(horizDragGesture, verticalDragGesture)) // .gesture(horizDragGesture.simultaneously(with: verticalDragGesture)) @@ -51,6 +50,8 @@ struct ContentView: View { } .padding(.trailing, 8) } + .background(Color("TempBackground")) // visually does nothing but lets the gesture work outside of the board, see FB7385742 + .gesture(self.horizDragGesture(geometry: geometry).simultaneously(with: self.verticalDragGesture)) Spacer() HStack { Button(action: { self.controller.rotate(direction: .counterClockwise) }) {