wpf - Center path content inside button -
i have simple path (just + sign) exported inkscape , use content of button when do, path off center.
<button height="24" width="24"> <viewbox horizontalalignment="center" verticalalignment="center" stretch="fill"> <path fill="#000000" data="m 11 5 l 11 11 l 5 11 l 5 13 l 11 13 l 11 19 l 13 19 l 13 13 l 19 13 l 19 11 l 13 11 l 13 5 l 11 5 z"/> </viewbox> </button>
i've wrapped in viewbox
can scale , i've tried playing horizontalalignment
, verticalalignment
, layoutrounding
don't seem affect positioning.
i'm guessing path data responsible this..probably starting first move (m) i'm not confident editing path manually.
is there way correct displays centered inside button? have many more buttons build i'd understand what's going on.
here's original svg:
<svg xmlns="http://www.w3.org/2000/svg" version="1" viewbox="0 0 24 24" enable-background="new 0 0 24 24" width="48" height="48"> <path style="text-indent:0;text-align:start;line-height:normal;text-transform:none;block-progression:tb;-inkscape-font-specification:bitstream vera sans" d="m 11 5 l 11 11 l 5 11 l 5 13 l 11 13 l 11 19 l 13 19 l 13 13 l 19 13 l 19 11 l 13 11 l 13 5 l 11 5 z" color="#000" overflow="visible" enable-background="accumulate" font-family="bitstream vera sans"/>
thank you!!
use this:
<button width="24" height="24"> <path margin="2" data="m 11 5 l 11 11 l 5 11 l 5 13 l 11 13 l 11 19 l 13 19 l 13 13 l 19 13 l 19 11 l 13 11 l 13 5 l 11 5 z" fill="#000000" stretch="fill" /> </button>
no need viewbox
when have path
Comments
Post a Comment