コード例 #1
0
ファイル: ResizeThumb.cs プロジェクト: xxy1991/cozy
        private void DragLeft(double scale, DesignerItem item, SelectionService selectionService)
        {
            IEnumerable<DesignerItem> groupItems = selectionService.GetGroupMembers(item).Cast<DesignerItem>();

            double groupLeft = Canvas.GetLeft(item) + item.Width;
            foreach (DesignerItem groupItem in groupItems)
            {
                double groupItemLeft = Canvas.GetLeft(groupItem);
                double delta = (groupLeft - groupItemLeft) * (scale - 1);
                Canvas.SetLeft(groupItem, groupItemLeft - delta);
                groupItem.Width = groupItem.ActualWidth * scale;
            }
        }
コード例 #2
0
ファイル: ResizeThumb.cs プロジェクト: xxy1991/cozy
 private void DragTop(double scale, DesignerItem item, SelectionService selectionService)
 {
     IEnumerable<DesignerItem> groupItems = selectionService.GetGroupMembers(item).Cast<DesignerItem>();
     double groupBottom = Canvas.GetTop(item) + item.Height;
     foreach (DesignerItem groupItem in groupItems)
     {
         double groupItemTop = Canvas.GetTop(groupItem);
         double delta = (groupBottom - groupItemTop) * (scale - 1);
         Canvas.SetTop(groupItem, groupItemTop - delta);
         groupItem.Height = groupItem.ActualHeight * scale;
     }
 }