Tweaks kmwembedded's touchMenuPos.

This commit is contained in:
jahorton 2019-05-02 08:26:48 +07:00
parent 36bc731b28
commit e27d351e51
2 changed files with 5 additions and 3 deletions

View file

@ -143,7 +143,7 @@ extension KeymanWebViewController {
}
let components = result.components(separatedBy: ",")
let x = CGFloat(Float(components[0])!)
let y = CGFloat(Float(components[1])!) + Manager.shared._inputViewController!.activeTopBarHeight // KMW doesn't adjust for this!
let y = CGFloat(Float(components[1])!)
let w = CGFloat(Float(components[2])!)
let h = CGFloat(Float(components[3])!)
completion(KeymanWebViewController.keyFrame(x: x, y: y, w: w, h: h))

View file

@ -407,8 +407,10 @@ namespace com.keyman.text {
var w=key.offsetWidth,
h=key.offsetHeight,
x=dom.Utils.getAbsoluteX(key) - dom.Utils.getAbsoluteX(osk.vkbd.kbdDiv) + w/2,
y=dom.Utils.getAbsoluteY(key) - dom.Utils.getAbsoluteY(osk.vkbd.kbdDiv);
// Since the full OSKManager '_Box' is displayed within the keyboards' WebViews,
// these calculations should be performed with respect to that, rather than osk.vkbd.kbdDiv.
x=dom.Utils.getAbsoluteX(key) - dom.Utils.getAbsoluteX(osk._Box) + w/2,
y=dom.Utils.getAbsoluteY(key) - dom.Utils.getAbsoluteY(osk._Box);
return x+','+y+','+w+','+h;
};