SVGAnimatedNumber.cpp 846 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2023, MacDue <macdue@dueutil.tech>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/Intrinsics.h>
  7. #include <LibWeb/SVG/SVGAnimatedNumber.h>
  8. namespace Web::SVG {
  9. JS::NonnullGCPtr<SVGAnimatedNumber> SVGAnimatedNumber::create(JS::Realm& realm, float base_val, float anim_val)
  10. {
  11. return realm.heap().allocate<SVGAnimatedNumber>(realm, realm, base_val, anim_val);
  12. }
  13. SVGAnimatedNumber::SVGAnimatedNumber(JS::Realm& realm, float base_val, float anim_val)
  14. : PlatformObject(realm)
  15. , m_base_val(base_val)
  16. , m_anim_val(anim_val)
  17. {
  18. }
  19. SVGAnimatedNumber::~SVGAnimatedNumber() = default;
  20. void SVGAnimatedNumber::initialize(JS::Realm& realm)
  21. {
  22. Base::initialize(realm);
  23. set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGAnimatedNumberPrototype>(realm, "SVGAnimatedNumber"));
  24. }
  25. }