private void UpdatePosition(Rect bookBounds) { var x = bookBounds.X + 6 + (bookBounds.Width - ActualSize.Width) * 0.5; var y = bookBounds.Y + bookBounds.Height + 18 + Config.Shelf3D.ShelfBoardHeight; var transform = MxM.Create(x, y); TransformMatrix = transform; }
private IMatrix GetTransform(double cummulatedDeltaX) { var f = MxM.Identity; var translateX = Math.Sign(cummulatedDeltaX) * FVCM.ActualSize.Width; var t = MxM.Create(translateX, 0); var p = Math.Abs(cummulatedDeltaX); p = MathX.Clamp(p, 0, 1); return(MxM.Progress(ref f, ref t, p)); }
public override void OnTransitionProgress(double progress) { var offsetX = HBS.ViewModel.Opened.ActualSize.Width * progress; var matrix = MxM.Create(offsetX, 0); HBS.ViewModel.Opened.BookVM.TransformMatrix = matrix; if (SwipeMode == SwipeMode.Book) { progress = Math.Abs(progress); } activeTransition.OnTransitionProgress(progress); }
private void UpdateSizeAndPosition() { Width = DrawViewModel.InfoShieldWidth; Height = DrawViewModel.RowHeight - DrawViewModel.ShelfHeight; TransformMatrix = MxM.Create(0, 0); }