Coder Social home page Coder Social logo

Setting canvas height about drawableview HOT 12 CLOSED

Odaym avatar Odaym commented on July 17, 2024
Setting canvas height

from drawableview.

Comments (12)

PaNaVTEC avatar PaNaVTEC commented on July 17, 2024

The pre draw listener you are using is async, not sync. So you are changing the configuration height after you setted the config. if you move the "drawable view.setConfig" inside the pre draw I think you achieve what you want. Check the code, the setConfig configures some things inside the drawableview.

from drawableview.

Odaym avatar Odaym commented on July 17, 2024

I get what you mean by I also tried to set the height to 200 or 50 manually without calculation or anything. I will try again and let you know

from drawableview.

PaNaVTEC avatar PaNaVTEC commented on July 17, 2024

@Odaym So the problem is that the canvas w/h you are setting is minor than the view w/h?

from drawableview.

Odaym avatar Odaym commented on July 17, 2024

Well no the problem is that regardless of what number I give I can still draw on all the height of the device

from drawableview.

PaNaVTEC avatar PaNaVTEC commented on July 17, 2024

I see, to reproduce it I setted canvas height to 100, my drawable view uses all the height and I can paint in all the height wich is not correct, the correct is to limit the view to the canvas height. I got it?

from drawableview.

Odaym avatar Odaym commented on July 17, 2024

Yep, that's it

from drawableview.

PaNaVTEC avatar PaNaVTEC commented on July 17, 2024

@Odaym I just uploaded a fix in the branch "limit_canvas_size" can you test it and tell me what do you think?

from drawableview.

Odaym avatar Odaym commented on July 17, 2024

You'll have to excuse me but I don't know how to do what you're suggesting. I can see the branch of course but I don't know what to do with a library that I usually include by specifying that gradle line that I'm used to. How do I test limit_canvas_size branch? I'm thinking that you maybe include the name of the branch in that line I use to include this library?

I tried using this answer to do it but I couldn't get it to download the repo to the path I was specifying http://stackoverflow.com/questions/13719676/gradle-how-to-clone-a-git-repo-in-a-task

from drawableview.

Odaym avatar Odaym commented on July 17, 2024

Alright, I cloned the repo to my computer but I couldn't get it to work as a library under my project

  1. Grab the "library" folder from the repo and place it under my project/libs and then ask gradle to compile it in build.gradle and settings.gradle

What I tried and did get to work was:

  1. Import the whole project DrawableView as a new project in AS and run it.

And I saw that it's perfectly working to limit the height of the canvas, it's great :) Thank you

Are you going to include this into master and upgrade the maven number so that people can include it still in 1 line as before?

from drawableview.

PaNaVTEC avatar PaNaVTEC commented on July 17, 2024

Hi, I'm still not happy with the solution and is not working good if you are using zoom, so I re-think and implement in a better way, if this is quite enough for you, see the build.gradle in the sample project how to import a dependency and you can work with this branch. I will fix it asap but I want to do some refactor before.

from drawableview.

Odaym avatar Odaym commented on July 17, 2024

Done, works fine when included into the project. I can see it running on my own app from that branch. But I will still wait for when its on master, for a much cleaner include process :P Thanks

from drawableview.

PaNaVTEC avatar PaNaVTEC commented on July 17, 2024

Released 0.6.0

from drawableview.

Related Issues (20)

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.