private RegionSelection.RectangleSelector CreateNewSelector()
        {
            var newSelector = new RectangleSelector(mManagers);
            newSelector.AddToManagers(mManagers);
            newSelector.Visible = false;
            newSelector.RegionChanged += new EventHandler(RegionChangedInternal);

            mRectangleSelectors.Add(newSelector);

            return newSelector;
        }
Ejemplo n.º 2
0
 private void HandleRegionPushed(object sender, EventArgs e)
 {
     this.mPushedRegion = sender as RectangleSelector;
 }
Ejemplo n.º 3
0
        private static void UpdateRectangleSelectorToFrame(AnimationFrameSave frame, Texture2D texture, RectangleSelector rectangleSelector)
        {
            rectangleSelector.Visible = texture != null;

            if (texture != null)
            {
                float leftPixel = frame.LeftCoordinate * texture.Width;
                float rightPixel = frame.RightCoordinate * texture.Width;
                float topPixel = frame.TopCoordinate * texture.Height;
                float bottomPixel = frame.BottomCoordinate * texture.Height;

                rectangleSelector.Left = leftPixel;
                rectangleSelector.Top = topPixel;
                rectangleSelector.Width = rightPixel - leftPixel;
                rectangleSelector.Height = bottomPixel - topPixel;
            }
        }
        private RegionSelection.RectangleSelector CreateNewSelector()
        {
            var newSelector = new RectangleSelector(mManagers);
            newSelector.AddToManagers(mManagers);
            newSelector.Visible = false;
            newSelector.RegionChanged += new EventHandler(RegionChangedInternal);
            newSelector.EndRegionChanged += EndRegionChangedInternal;
            newSelector.SnappingGridSize = snappingGridSize;
            newSelector.RoundToUnitCoordinates = mRoundRectangleSelectorToUnit;

            mRectangleSelectors.Add(newSelector);

            return newSelector;
        }