Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Control border shows exceed canvas area. (Read 3256 times)
Yogendra
Junior Member
**
Offline


I Love MindFusion!

Posts: 68
Joined: Dec 27th, 2012
Control border shows exceed canvas area.
Feb 5th, 2013 at 6:48am
Print Post  
Hi, Stoyo

First of all thanks for your help.

I working with diagram, as code here

dim BGBounds as rect = New Rect(0, 0, TemplateWidth, TemplateHeight)
BGNode = diagram.Factory.CreateContainerNode(BGBounds)
With BGNode
.Id = BackgroundID
.Constraints.KeepInsideParent = True
.AllowRemoveChildren = False
.Locked = True
.ImageAlign = ImageAlign.Center
.Transparent = True
.Name = BackgroundName
End With
With diagram
.AutoResize = AutoResize.None
.Behavior = Behavior.Modify
.AlignToGrid = True
.AutoScroll = True
.MeasureUnit = MindFusion.Diagramming.Silverlight.GraphicsUnit.Pixel
.AdjustmentHandlesSize = 10
.ShapeBrush = NodeBrush
.Bounds = BGBounds
.ShowGrid = True
End With



This code show canvas area in my screen. I can draw any shape node and also increase border size from numeric up down button. Code is here:-

For Lop = 0 To diagram.Nodes.Count - 1
If diagram.Nodes(Lop).Selected = True Then
Dim node As ShapeNode = diagram.Nodes(Lop)
Dim Pen As Pen = node.Pen
node.Pen = Nothing
node.Pen = Pen
node.StrokeThickness = spnBorderSize.Value
End If
Next Lop


spnBorderSize is name of numeric up down button. The problem is, If the control is placed very near the the canvas area, on increasing border thickness the increased thickness gets out of the canvas area. I want to restrict this within the canvas area. also when I move the control somewhere in the middle of the canvas, I should see the whole border with the specified thickness.

As you can see in snap shot. Blue line show canvas area boundary.

Thanks in advance. Sad
  

ControlBorderOverCanvasArea.PNG (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Control border shows exceed canvas area.
Reply #1 - Feb 5th, 2013 at 6:45pm
Print Post  
Hi,

It doesn't look like Silverlight's Path objects used in ShapeNode (and derived ContainerNode) template support drawing with inset pens. You will have to either subtract half the StrokeThickness from all sides of your BGNode's Bounds, or use a custom template that draws the node using a Border element.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint