Coder Social home page Coder Social logo

Comments (2)

clifftm avatar clifftm commented on May 30, 2024 1

Description:
The first call redraw() appears in a constructor (line 79). But component is not in focus, so
if (this.options.enableCursor && this.isFocus) this.DrawCursor()
not executes

But there is also no call of this.DrawCursor() In the chain:
focus() -> AddEvent() -> window.setInterval(this.cursorTimerEvent.bind(this), this.options.cursorStyle.speedSwap) -> this.displayCursor(true, this.blindStatus, this.cursorWorldPosition)

on fireTextChange() the cursor can be drawn on line(368)
if (this.textComponent.height - this.lastComponentHeight > 0) this.redraw()
but it will not, because by default textComponent.height = 40 and lastCimponentHeight = 40 + 10 = 50. Even if padding = 0, the condition will 40-40 > 0 = false. Probably it should be >= ?

Accroding to that i fixed it in my code by such hack
option.onFocus = ()=> {
//only to compute this.changeCursorPosition(cursorPosition)
drawInput.fireTextChange(option.value,option.value,option.value.length);
//only for drawCursor
drawInput.redraw();
}

I wish you will fix that soon better way as you understand you sources much better

from pixi-drawable-textinput.

Osarel avatar Osarel commented on May 30, 2024

hello, thank you for this issue, I created the single Line function but I do not use it personally I did not notice the bugs, it must be a simple cursor location error, I am looking at that soon

from pixi-drawable-textinput.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.