简体   繁体   English

图分割

[英]Diagram Splitting

Hi i would like to split my Diagram in four Parts, so i defined 4 equal Rectangle, but in bounds3 and bounds4 there still some missing Nodes. 嗨,我想将我的图分为四个部分,所以我定义了4个相等的Rectangle,但是在bounds3和bounds4中仍然有一些缺失的节点。 can anyone help! 谁能帮忙!

//b = (X, Y, Width, Height).
// Original Diagram
Rect b = activeDiagram.Panel.DiagramBounds; // b = (-370, -190, 3099, 2450).

Rect bounds1 = new Rect(b.X, b.Y, w/2, h/2); //top left corner
Rect bounds2 = new Rect(b.X, b.Y + h/2, w/2, h/2); //bottom left corner
Rect bounds3 = new Rect(b.X + w/2, b.Y, w/2, h/2); //top right corner 
Rect bounds4 = new Rect(b.X + w/2, b.Y + h/2, w/2, h/2); //bottom right corner

It seems you can loose one-point wide strips with integer division (3099 div 2 + 3099 div 2 = 3098) 似乎可以用整数除法(3099 div 2 + 3099 div 2 = 3098)来松开一点宽的条

Use width = w - w/2 for right column and height = h - h/2 for bottom row to cover all the initial rectangle. 对于右列使用width = w-w / 2,对于下一行使用height = h-h / 2以覆盖所有初始矩形。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM