mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-10 12:44:53 +00:00
Merge branch 'master' into beta
This commit is contained in:
commit
b0bd722a1f
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -106,7 +106,9 @@ namespace app {
|
||||
}
|
||||
|
||||
int getDimensionById(const std::string& id) {
|
||||
return m_dimensions_by_id[id] * ui::guiscale();
|
||||
// Warning! Don't use ui::guiscale(), as CurrentTheme::get()
|
||||
// is still nullptr when we use this getDimensionById()
|
||||
return m_dimensions_by_id[id] * this->guiscale();
|
||||
}
|
||||
|
||||
gfx::Color getColorById(const std::string& id) {
|
||||
|
@ -90,9 +90,15 @@ KeyModifiers get_modifiers_from_nsevent(NSEvent* event)
|
||||
CFStringRef get_unicode_from_key_code(NSEvent* event,
|
||||
const bool translateDeadKeys)
|
||||
{
|
||||
TISInputSourceRef inputSource = TISCopyCurrentKeyboardInputSource();
|
||||
// The "TISCopyCurrentKeyboardInputSource()" doesn't contain
|
||||
// kTISPropertyUnicodeKeyLayoutData (returns nullptr) when the input
|
||||
// source is Japanese (Romaji/Hiragana/Katakana).
|
||||
|
||||
//TISInputSourceRef inputSource = TISCopyCurrentKeyboardInputSource();
|
||||
TISInputSourceRef inputSource = TISCopyCurrentKeyboardLayoutInputSource();
|
||||
CFDataRef keyLayoutData = (CFDataRef)TISGetInputSourceProperty(inputSource, kTISPropertyUnicodeKeyLayoutData);
|
||||
const UCKeyboardLayout* keyLayout = (const UCKeyboardLayout*)CFDataGetBytePtr(keyLayoutData);
|
||||
const UCKeyboardLayout* keyLayout =
|
||||
(keyLayoutData ? (const UCKeyboardLayout*)CFDataGetBytePtr(keyLayoutData): nullptr);
|
||||
|
||||
UInt32 deadKeyState = (translateDeadKeys ? g_lastDeadKeyState: 0);
|
||||
UniChar output[4];
|
||||
|
Loading…
x
Reference in New Issue
Block a user