View unanswered posts | View active topics It is currently 2019-11-15 9:14



Reply to topic  [ 2 posts ] 
 setSize之后矢量图片变形 
Author Message
新手上路

Joined: 2019-04-03 17:52
Posts: 3
Post setSize之后矢量图片变形
Code:
const lane = {
  font: FONT.normal,
  fill: COLOR.background,
  line(data) {
    return {
      width: 1,
      color: COLOR[data.getClient('focus') ? 'active' : 'line']
    };
  },
  w: NETWORK.repulsion.column,
  h: 234,
  origin: {
    x: 0,
    y: 0
  },
  v: [
    {
      shape: 'rect',
      rect: {
        w: NETWORK.repulsion.column, h: 34, y: 1
      }
    },
    {
      shape: 'line',
      p1: { x: NETWORK.repulsion.column, y: 34 },
      p2: { x: NETWORK.repulsion.column, y: 234 },
      line: {
        width: 1,
        dash: [10, 5]
      },
      alpha: 0.5
    },
    {
      shape: 'line',
      p1: { x: 0, y: 34 },
      p2: { x: 0, y: 234 },
      line: {
        width: 1,
        dash: [10, 5]
      },
      alpha: 0.5
    }
  ]
};

网元在调用setSize增加宽高后,会变形


Attachments:
TIM图片20190409162239.png
TIM图片20190409162239.png [ 8.05 KiB | Viewed 426 times ]
2019-04-09 16:23
Profile
新手上路

Joined: 2019-03-04 14:41
Posts: 15
Post Re: setSize之后矢量图片变形
矢量图上这是正常现象,有个解决方法是,在你创建网元大小时和创建绘制的矢量图的大小时自己要算一下他的比例问题,比如网元大小为10,10 , 那么在创建矢量图时 w:10, h:10,在这样的区域进行绘制,当你需要改变网元大小时,网元的宽高进行等比例的改变。这样缩放出来的矢量图效果会好一点。


2019-04-16 10:06
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron