Text.js 797 B

123456789101112131415161718192021222324252627282930313233343536
  1. import VectorType from "../enum/VectorType.js";
  2. import Geometry from "./Geometry.js";
  3. import { mathUtil } from "../Util/MathUtil.js";
  4. import { coordinate } from "../Coordinate.js";
  5. import Constant from "../Constant.js";
  6. import Style from "@/graphic/CanvasStyle/index.js";
  7. //不靠墙
  8. export default class Text extends Geometry {
  9. constructor(center, vectorId) {
  10. super();
  11. this.center = center;
  12. this.value = "固定点";
  13. this.angle = 0;
  14. this.color = Style.Text.fillStyle;
  15. this.fontSize = Style.Text.fontSize;
  16. this.geoType = VectorType.Text;
  17. this.setId(vectorId);
  18. }
  19. getAngle() {
  20. return this.angle;
  21. }
  22. setAngle(angle) {
  23. this.angle = angle;
  24. }
  25. setValue(value) {
  26. this.value = value;
  27. }
  28. setFontSize(value) {
  29. this.fontSize = value;
  30. }
  31. }