Livecode Wiki
Advertisement

SVG widget

This widget displays an SVG path as an icon. It has a default state and a "highlighted" state.

The SVG graphic can be scaled or zoomed without loosing resolution.

Properties[]

  • angle
  • FillRule
  • flipped: true if the SVG path is flipped top-to-bottom; false otherwise
  • highlight: true if the SVG path is highlighted; false otherwise
  • IconPath: The SVG path string to be displayed by the SVG path widget. It the SVG code as per https://www.w3.org/TR/SVG/paths.html#PathData . IconPath example:
M512 1088Q512 1052 492 1019 491 1018 476.5 996.5 462 975 451 958.5 440 942 426 914.5  412 887 405 864 401 848 384 848 367 848 363 864 356 887 342 914.5 328 942 317 958.5 306 975 291.5 996.5 277 1018 276 1019 256 1052 256 1088 256 1141 293.5 1178.5 331 1216 384 1216 437 1216 474.5 1178.5 512 1141 512 1088ZM1024 960Q1024 1172 874 1322 724 1472 512 1472 300 1472 150 1322 0 1172 0 960 0 815 81 685 87 676 143.5 594.5 200 513 244.5 443.5 289 374 344 265.5 399 157 427 64 436 34 461 17 486 0 512 0 538 0 563.5 17 589 34 597 64 625 157 680 265.5 735 374 779.5 443.5 824 513 880.5 594.5 937 676 943 685 1024 812 1024 960Z
  • iconPresetName: Use the iconPresetName property to set the icon of the widget to one of the predefined graphics provided by the "IconSVG" library. You can get a list of available predefined path names by iconNames
  • maintainAspectRatio: If true, the icon will be its maximum size within its bounds while maintaining the original ratio of width to height. If false, it will stretch to fit the extent of its bounds.
  • scaledHeight: if true, then the scaledHeight of the object will return the height of the bounding rect of the SVG path. Otherwise, it will return the height of the widget.
  • scaledWidth: If true, then the scaledWidth of the object will return the width of the bounding rect of the SVG path. Otherwise, it will return the width of the widget
Advertisement