diff --git a/druid/base/drag.lua b/druid/base/drag.lua index d9f5e19..249a664 100644 --- a/druid/base/drag.lua +++ b/druid/base/drag.lua @@ -278,7 +278,11 @@ function Drag.on_input(self, action_id, action) end if self.is_drag then - self.on_drag:trigger(self:get_context(), self.dx, self.dy, self.x - self.touch_start_pos.x, self.y - self.touch_start_pos.y) + self.on_drag:trigger(self:get_context(), + self.dx * self._x_koef, + self.dy * self._y_koef, + (self.x - self.touch_start_pos.x) * self._x_koef, + (self.y - self.touch_start_pos.y) * self._y_koef) end return self.is_drag diff --git a/druid/base/scroll.lua b/druid/base/scroll.lua index 01fbdd4..5de95c7 100755 --- a/druid/base/scroll.lua +++ b/druid/base/scroll.lua @@ -743,7 +743,6 @@ function Scroll._process_scroll_wheel(self, action_id, action) return false end - local koef = (action_id == const.ACTION_SCROLL_UP) and 1 or -1 if self.style.WHEEL_SCROLL_INVERTED then koef = -koef diff --git a/druid/extended/layout.lua b/druid/extended/layout.lua index b242eb6..eeaa77d 100644 --- a/druid/extended/layout.lua +++ b/druid/extended/layout.lua @@ -49,13 +49,7 @@ function Layout:on_window_resized() return end - local window_x, window_y = window.get_size() - local stretch_x = window_x / self.gui_size.x - local stretch_y = window_y / self.gui_size.y - - local x_koef = self.fit_size.x / self.origin_size.x * stretch_x / math.min(stretch_x, stretch_y) - local y_koef = self.fit_size.y / self.origin_size.y * stretch_y / math.min(stretch_x, stretch_y) - + local x_koef, y_koef = helper.get_screen_aspect_koef() local new_size = vmath.vector3(self.origin_size) if self.mode == const.LAYOUT_MODE.STRETCH_X or self.mode == const.LAYOUT_MODE.STRETCH then diff --git a/druid/styles/default/style.lua b/druid/styles/default/style.lua index bd18a78..a4d4dbc 100644 --- a/druid/styles/default/style.lua +++ b/druid/styles/default/style.lua @@ -147,4 +147,9 @@ M["text"] = { } +M["hotkey"] = { + MODIFICATORS = {}, -- Add key ids to mark it as modificator keys +} + + return M diff --git a/example/example.gui b/example/example.gui index f613534..64f0e71 100644 --- a/example/example.gui +++ b/example/example.gui @@ -274,7 +274,7 @@ nodes { xanchor: XANCHOR_NONE yanchor: YANCHOR_NONE pivot: PIVOT_N - adjust_mode: ADJUST_MODE_STRETCH + adjust_mode: ADJUST_MODE_FIT parent: "lobby_view" layer: "" inherit_alpha: true