This repository was archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Text field typing lag #24
Copy link
Copy link
Open
Description
There is a noticeable amount of delay between typing and text appearing in the text field. The code is still pretty simple:
defmodule Mudex.Scene.Home do
use Scenic.Scene
require Logger
alias Scenic.Graph
alias Scenic.ViewPort
import Scenic.Primitives
import Scenic.Components
@text_size 18
@graph Graph.build(font_size: @text_size)
# ============================================================================
# setup
# --------------------------------------------------------
def init(_, opts) do
# get the width and height of the viewport. This is to demonstrate creating
# a transparent full-screen rectangle to catch user input
{:ok, %ViewPort.Status{size: {width, height}}} = ViewPort.info(opts[:viewport])
graph =
@graph
|> text("Hello Scenic!", fill: :white, translate: {5, 15})
|> text_field("",
id: :input,
width: width - 10,
translate: {5, height - 40}
)
{:ok, graph, push: graph}
end
def handle_input(event, _context, state) do
Logger.info("Received event: #{inspect(event)}")
{:noreply, state}
end
endI'm running this on an HP Pavilion laptop running Ubuntu 18.04. I'm happy to provide any additional information. I also took a quick video trying to demonstrate what I'm seeing, if there is a reasonable place to put that.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels