SVGMarkerElement: orientAngle property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Thuộc tính chỉ đọc orientAngle của giao diện SVGMarkerElement trả về một đối tượng SVGAnimatedAngle chứa góc của thuộc tính orient.

Giá trị

Một đối tượng SVGAnimatedAngle. Thuộc tính baseVal của đối tượng này trả về một SVGAngle, giá trị của nó trả về angle.

Ví dụ

Thuộc tính orientAngle trả về một SVGAnimatedAngle chứa một SVGAngle với góc được đặt bởi thuộc tính orient dưới dạng một số biểu thị số độ mà điểm đánh dấu được xoay.

html
<svg id="svg" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <marker
      id="arrow"
      viewBox="0 0 10 10"
      refX="5"
      refY="5"
      markerWidth="6"
      markerHeight="6"
      orient=".5turn">
      <path d="M 0 0 L 10 5 L 0 10 z" />
    </marker>
  </defs>
</svg>
js
let marker = document.getElementById("arrow");
console.log(marker.orientAngle.baseVal.value); // 180 as .5turn is 180deg.

Thông số kỹ thuật

Specification
Scalable Vector Graphics (SVG) 2
# __svg__SVGMarkerElement__orientAngle

Tương thích trình duyệt