Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ComputerSolitaire/Animation/UndoAnimationCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ enum UndoAnimationCoordinator {
}
return Plan(items: items, targets: targets, needsPostUndoFrames: true)

case .dealTableauRow:
// Spider's dealt row flies from the tableau (or a banked run's pile)
// back onto the stock; unlike a waste draw there is no fan position
// to fall back to when a card's frame is unknown.
for (index, id) in cardIDs.enumerated() {
guard let card = beforeCards[id] ?? afterCards[id],
let startFrame = cardFrames[id] else { continue }
items.append(UndoAnimationItem(id: id, card: card, startFrame: startFrame, endFrame: startFrame))
targets[id] = .stock(index)
}
return Plan(items: items, targets: targets, needsPostUndoFrames: false)

case .flipTableauTop:
return Plan(items: [], targets: [:], needsPostUndoFrames: false)
}
Expand Down
4 changes: 2 additions & 2 deletions ComputerSolitaire/Animation/WinCelebrationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ final class WinCelebrationController {
}

var launchFrames: [Int: CGRect] = [:]
for index in 0..<4 {
for index in foundations.indices {
if let frame = dropFrames[.foundation(index)]?.snapFrame, frame != .zero {
launchFrames[index] = frame
}
Expand Down Expand Up @@ -159,7 +159,7 @@ final class WinCelebrationController {
guard boardBounds.width > 0, boardBounds.height > 0 else { return [] }

var launchFrames: [Int: CGRect] = [:]
for index in 0..<4 {
for index in foundations.indices {
if let frame = dropFrames[.foundation(index)]?.snapFrame, frame != .zero {
launchFrames[index] = frame
}
Expand Down
3 changes: 2 additions & 1 deletion ComputerSolitaire/Fixtures/ScreenshotFixtures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ enum ScreenshotFixtures {
static let bundled: [ScreenshotFixture] = [
ScreenshotFixture(name: "klondike-draw3", title: "Klondike – Draw 3"),
ScreenshotFixture(name: "freecell", title: "FreeCell – fresh deal"),
ScreenshotFixture(name: "yukon", title: "Yukon – fresh deal")
ScreenshotFixture(name: "yukon", title: "Yukon – fresh deal"),
ScreenshotFixture(name: "spider", title: "Spider – 2 suits")
]

static func payloadFromLaunchArguments() -> SavedGamePayload? {
Expand Down
Loading