Comments (12)
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.
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.
@Odaym So the problem is that the canvas w/h you are setting is minor than the view w/h?
from drawableview.
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.
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.
Yep, that's it
from drawableview.
@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.
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.
Alright, I cloned the repo to my computer but I couldn't get it to work as a library under my project
- 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:
- 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.
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.
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.
Released 0.6.0
from drawableview.
Related Issues (20)
- Ability to center canvas on w/h of the view HOT 7
- Set a color for background and canvas border
- supporting adding text
- Thanks guy!
- setBackgroundColor does not have an effect on the obtained bitmap HOT 2
- [SOLVED] Black Image in saved bitmap HOT 3
- appear android.os.BadParcelableException error HOT 2
- Saving Background bitmap with drawn paint causes the app to crash? HOT 1
- Maven Central artifact is dirty
- Drawableview no track
- Can we set a bitmap as the canvas background? HOT 1
- :( HOT 1
- Run very very slow if you use a background
- Disable Touch Listener
- Referenced class is missing
- How to set the color that has been drawn?
- what is the Lib version and the mvn central badge HOT 1
- ERROR: Failed to resolve: me.panavtec:drawableview:0.6.0
- Can't draw if widget are inside NestedScrollView
- Parcelable protocol requires that the class implements Parcelable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drawableview.