Camera and editor improvements

This commit is contained in:
Ilya Laktyushin 2023-06-14 20:37:17 +04:00
parent b6420c4405
commit 1a80c230c4
2 changed files with 64 additions and 62 deletions

View File

@ -334,68 +334,68 @@ public final class DrawingEntitiesView: UIView, TGPhotoDrawingEntitiesView {
} }
view.containerView = self view.containerView = self
// let processSnap: (Bool, UIView) -> Void = { [weak self] snapped, snapView in let processSnap: (Bool, UIView) -> Void = { [weak self] snapped, snapView in
// guard let self else { guard let self else {
// return return
// } }
// let transition = ContainedViewLayoutTransition.animated(duration: 0.2, curve: .easeInOut) let transition = ContainedViewLayoutTransition.animated(duration: 0.2, curve: .easeInOut)
// if snapped { if snapped {
// self.insertSubview(snapView, belowSubview: view) self.insertSubview(snapView, belowSubview: view)
// if snapView.alpha < 1.0 { if snapView.alpha < 1.0 {
// self.hapticFeedback.impact(.light) self.hapticFeedback.impact(.light)
// } }
// transition.updateAlpha(layer: snapView.layer, alpha: 1.0) transition.updateAlpha(layer: snapView.layer, alpha: 1.0)
// } else { } else {
// transition.updateAlpha(layer: snapView.layer, alpha: 0.0) transition.updateAlpha(layer: snapView.layer, alpha: 0.0)
// } }
// } }
//
// view.onSnapUpdated = { [weak self, weak view] type, snapped in view.onSnapUpdated = { [weak self, weak view] type, snapped in
// guard let self else { guard let self else {
// return return
// } }
// switch type { switch type {
// case .centerX: case .centerX:
// processSnap(snapped, self.xAxisView) processSnap(snapped, self.xAxisView)
// case .centerY: case .centerY:
// processSnap(snapped, self.yAxisView) processSnap(snapped, self.yAxisView)
// case .top: case .top:
// processSnap(snapped, self.topEdgeView) processSnap(snapped, self.topEdgeView)
// self.edgePreviewUpdated(snapped) self.edgePreviewUpdated(snapped)
// case .left: case .left:
// processSnap(snapped, self.leftEdgeView) processSnap(snapped, self.leftEdgeView)
// self.edgePreviewUpdated(snapped) self.edgePreviewUpdated(snapped)
// case .right: case .right:
// processSnap(snapped, self.rightEdgeView) processSnap(snapped, self.rightEdgeView)
// self.edgePreviewUpdated(snapped) self.edgePreviewUpdated(snapped)
// case .bottom: case .bottom:
// processSnap(snapped, self.bottomEdgeView) processSnap(snapped, self.bottomEdgeView)
// self.edgePreviewUpdated(snapped) self.edgePreviewUpdated(snapped)
// case let .rotation(angle): case let .rotation(angle):
// let transition = ContainedViewLayoutTransition.animated(duration: 0.2, curve: .easeInOut) let transition = ContainedViewLayoutTransition.animated(duration: 0.2, curve: .easeInOut)
// if let angle, let view { if let angle, let view {
// self.layer.insertSublayer(self.angleLayer, below: view.layer) self.layer.insertSublayer(self.angleLayer, below: view.layer)
// self.angleLayer.transform = CATransform3DMakeRotation(angle, 0.0, 0.0, 1.0) self.angleLayer.transform = CATransform3DMakeRotation(angle, 0.0, 0.0, 1.0)
// if self.angleLayer.opacity < 1.0 { if self.angleLayer.opacity < 1.0 {
// self.hapticFeedback.impact(.light) self.hapticFeedback.impact(.light)
// } }
// transition.updateAlpha(layer: self.angleLayer, alpha: 1.0) transition.updateAlpha(layer: self.angleLayer, alpha: 1.0)
// } else { } else {
// transition.updateAlpha(layer: self.angleLayer, alpha: 0.0) transition.updateAlpha(layer: self.angleLayer, alpha: 0.0)
// } }
// } }
// } }
// view.onPositionUpdated = { [weak self] position in view.onPositionUpdated = { [weak self] position in
// if let self { if let self {
// self.angleLayer.position = position self.angleLayer.position = position
// } }
// } }
// view.onInteractionUpdated = { [weak self] interacting in view.onInteractionUpdated = { [weak self] interacting in
// if let self { if let self {
// self.onInteractionUpdated(interacting) self.onInteractionUpdated(interacting)
// } }
// } }
//
view.update() view.update()
self.addSubview(view) self.addSubview(view)

View File

@ -989,6 +989,8 @@ extension Stories.StoredItem {
base = .contacts base = .contacts
case .privacyValueAllowCloseFriends: case .privacyValueAllowCloseFriends:
base = .closeFriends base = .closeFriends
case .privacyValueDisallowAll:
base = .nobody
case let .privacyValueAllowUsers(users): case let .privacyValueAllowUsers(users):
for id in users { for id in users {
additionalPeerIds.append(EnginePeer.Id(namespace: Namespaces.Peer.CloudUser, id: EnginePeer.Id.Id._internalFromInt64Value(id))) additionalPeerIds.append(EnginePeer.Id(namespace: Namespaces.Peer.CloudUser, id: EnginePeer.Id.Id._internalFromInt64Value(id)))