diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-14 12:33:40 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-14 12:33:40 +0100 |
| commit | f24ed33faaa8d7db6822a9ff4c1eff57617caf83 (patch) | |
| tree | 4cfccee06d5b7a652f8aafae0f93b4a3c54c5670 /CrowIDE/src/GraphicObjectDesignContainer.cs | |
| parent | 5f1d0213e0dadecc8f93d44e36ea3a11a1aa9baa (diff) | |
dragndrop of GObjs
Diffstat (limited to 'CrowIDE/src/GraphicObjectDesignContainer.cs')
| -rw-r--r-- | CrowIDE/src/GraphicObjectDesignContainer.cs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/CrowIDE/src/GraphicObjectDesignContainer.cs b/CrowIDE/src/GraphicObjectDesignContainer.cs index e7776d26..4540898b 100644 --- a/CrowIDE/src/GraphicObjectDesignContainer.cs +++ b/CrowIDE/src/GraphicObjectDesignContainer.cs @@ -30,6 +30,14 @@ namespace Crow.Coding { public class GraphicObjectDesignContainer { + #region CTOR + public GraphicObjectDesignContainer (Type crowType) + { + CrowType = crowType; + } + #endregion + + int dragIconSize = 32; public Type CrowType; public string IconPath { @@ -38,24 +46,18 @@ namespace Crow.Coding public string DisplayName { get { return CrowType.Name; } } - - public GraphicObjectDesignContainer (Type crowType) - { - CrowType = crowType; - } - int dis = 32; void onStartDrag (object sender, EventArgs e) { GraphicObject go = sender as GraphicObject; lock (go.IFace.UpdateMutex) { - go.IFace.DragImageHeight = dis; - go.IFace.DragImageWidth = dis; + go.IFace.DragImageHeight = dragIconSize; + go.IFace.DragImageWidth = dragIconSize; SvgPicture pic = new SvgPicture (); pic.Load (go.IFace, IconPath); - ImageSurface img = new ImageSurface (Format.Argb32, dis, dis); + ImageSurface img = new ImageSurface (Format.Argb32, dragIconSize, dragIconSize); using (Context ctx = new Context (img)) { - Rectangle r = new Rectangle (0, 0, dis, dis); + Rectangle r = new Rectangle (0, 0, dragIconSize, dragIconSize); pic.Paint (ctx, r); ctx.Operator = Operator.In; ctx.SetSourceRGBA (1.0, 1.0, 1.0, 1.0); |