Skip to content

Commit 7789f09

Browse files
committed
fix: fix compile issue.
1 parent 6d5fd26 commit 7789f09

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

bridge/core/events/deviceorientation_event.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
*/
44

55
#include "deviceorientation_event.h"
6-
#include "qjs_device_orientation_event.h"
6+
#include "qjs_deviceorientation_event.h"
7+
#include "qjs_deviceorientation_event_init.h"
78

89
namespace webf {
910

@@ -28,7 +29,7 @@ DeviceorientationEvent::DeviceorientationEvent(ExecutingContext* context,
2829
const std::shared_ptr<DeviceorientationEventInit>& initializer,
2930
ExceptionState& exception_state)
3031
: Event(context, type),
31-
absolute_(initializer->hasAbsolute ? initializer->absolute()),
32+
absolute_(initializer->hasAbsolute() ? initializer->absolute() : 0.0),
3233
alpha_(initializer->hasAlpha() ? initializer->alpha() : 0.0),
3334
beta_(initializer->hasBeta() ? initializer->beta() : 0.0),
3435
gamma_(initializer->hasGamma() ? initializer->gamma() : 0.0) {}

bridge/core/events/deviceorientation_event.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Event} from "../dom/events/event";
2-
import {DeviceorientationEventInit} from "./device_orientation_event_init";
2+
import {DeviceorientationEventInit} from "./deviceorientation_event_init";
33

44
interface DeviceorientationEvent extends Event {
55
readonly absolute: boolean;

bridge/core/events/deviceorientation_event.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
* Copyright (C) 2024-present The WebF authors. All rights reserved.
33
*/
44

5-
#ifndef BRIDGE_CORE_EVENTS_GESTURE_EVENT_H_
6-
#define BRIDGE_CORE_EVENTS_GESTURE_EVENT_H_
5+
#ifndef BRIDGE_CORE_EVENTS_DEVICE_ORIENTATION_EVENT_H_
6+
#define BRIDGE_CORE_EVENTS_DEVICE_ORIENTATION_EVENT_H_
77

88
#include "bindings/qjs/dictionary_base.h"
99
#include "bindings/qjs/source_location.h"
1010
#include "core/dom/events/event.h"
11-
#include "qjs_device_orientation_event_init.h"
11+
#include "qjs_deviceorientation_event_init.h"
1212

1313
namespace webf {
1414

1515
struct NativeDeviceorientationEvent;
16+
class DeviceorientationEventInit;
1617

1718
class DeviceorientationEvent : public Event {
1819
DEFINE_WRAPPERTYPEINFO();
@@ -52,4 +53,4 @@ class DeviceorientationEvent : public Event {
5253

5354
} // namespace webf
5455

55-
#endif // BRIDGE_CORE_EVENTS_GESTURE_EVENT_H_
56+
#endif // BRIDGE_CORE_EVENTS_DEVICE_ORIENTATION_EVENT_H_

0 commit comments

Comments
 (0)