Example #1
0
 public Brush()
 {
     _lastUsedSize = new SizeInt32(0, 0);
     _image = new BitmapImage(new Uri(@"pack://application:,,,/TEdit;component/Images/Tools/paintbrush.png"));
     _name = "Brush";
     _type = ToolType.Brush;
     _isActive = false;
 }
 public bool Equals(SizeInt32 p)
 {
     return MatchFields(this, p);
 }
 private static bool MatchFields(SizeInt32 a, SizeInt32 m)
 {
     return (a.Width == m.Width && a.Height == m.Height);
 }
Example #4
0
        public override bool PressTool(TileMouseEventArgs e)
        {
            if (!_isRightDown && !_isLeftDown)
                _startPoint = e.Tile;

            if ((_properties.Height > 0 && _properties.Width > 0) &&
                (_lastUsedSize.Width != _properties.Width || _lastUsedSize.Height != _properties.Height))
                _lastUsedSize = new SizeInt32(_properties.Height, _properties.Width);

            CheckDirectionandDraw(e);
            _isLeftDown = (e.LeftButton == MouseButtonState.Pressed);
            _isRightDown = (e.RightButton == MouseButtonState.Pressed);
            return true;
        }