Skip to content

Commit 2abbf9a

Browse files
committed
Fix Windows build
1 parent cf0aea3 commit 2abbf9a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

shared/cc/Window.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void jwm::Window::dispatch(jobject event) {
1212
jwm::classes::Consumer::accept(fEnv, fWindow, event);
1313
}
1414

15-
bool jwm::Window::getRectForMarkedRange(jint selectionStart, jint selectionEnd, jwm::IRect& rect) {
15+
bool jwm::Window::getRectForMarkedRange(jint selectionStart, jint selectionEnd, jwm::IRect& rect) const {
1616
JNILocal<jobject> client(fEnv, fEnv->GetObjectField(fWindow, jwm::classes::Window::kTextInputClient));
1717
jwm::classes::Throwable::exceptionThrown(fEnv);
1818
if (client.get()) {

shared/cc/Window.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace jwm {
1313

1414
void dispatch(jobject event);
1515

16-
bool getRectForMarkedRange(jint selectionStart, jint selectionEnd, jwm::IRect& rect);
16+
bool getRectForMarkedRange(jint selectionStart, jint selectionEnd, jwm::IRect& rect) const;
1717

1818
JNIEnv* fEnv = nullptr;
1919
jobject fWindow = nullptr;

windows/cc/WindowWin32.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ LRESULT jwm::WindowWin32::processEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
368368
// assume page scroll
369369
// https://github.com/mozilla/gecko-dev/blob/da97cbad6c9f00fc596253feb5964a8adbb45d9e/widget/windows/WinMouseScrollHandler.cpp#L891-L903
370370
if (linesPerTick > WHEEL_DELTA) {
371-
float sign = ticks > 0 ? 1 : ticks < 0 ? -1 : 0;
371+
float sign = ticks > 0.0f ? 1.0f : ticks < 0.0f ? -1.0f : 0.0f;
372372
JNILocal<jobject> eventMouseScroll(env, classes::EventMouseScroll::make(env, 0.0f, getContentRect().getHeight() * sign, 0.0f, 0.0f, sign, modifiers));
373373
dispatch(eventMouseScroll.get());
374374
} else {
@@ -880,9 +880,9 @@ void jwm::WindowWin32::_imeGetCompositionStringConvertedRange(HIMC hImc, int &se
880880
bool jwm::WindowWin32::_imeGetRectForMarkedRange(IRect &rect) const {
881881
// Query current cursor position
882882
// If composition starts, Pos will be always 0
883-
auto sectionStart = static_cast<int>(_compositionPos);
884-
auto sectionEnd = sectionStart + 0;
885-
return this->getRectForMarkedRange(selectionStart, selectionEnd, rect);
883+
auto selectionStart = static_cast<int>(_compositionPos);
884+
auto selectionEnd = selectionStart + 0;
885+
return getRectForMarkedRange(selectionStart, selectionEnd, rect);
886886
}
887887

888888
std::wstring jwm::WindowWin32::_imeGetCompositionString(HIMC hImc, DWORD compType) const {

0 commit comments

Comments
 (0)