@chief-editor/shape
Version:
Shape for chief editor
1 lines • 1.03 kB
JavaScript
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},__rest=this&&this.__rest||function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(r[i[o]]=t[i[o]])}return r};import React from"react";export function Rect(t){var e=t.width,r=t.height,i=(t.ratio,t.strokeDasharray),o=t.strokeWidth,a=void 0===o?0:o,n=__rest(t,["ratio","strokeDasharray","strokeWidth"]),s={x:0,y:0,width:e,height:r};return i&&(s.x=a/2,s.y=a/2,s.width=e-a,s.height=r-a),React.createElement("svg",{width:e,height:r,viewBox:"0 0 "+e+" "+r,fill:"none"},React.createElement("rect",__assign({},n,s,{strokeDasharray:i,strokeWidth:a})))}