karankalsi / PlayLikeCurl

Page Curl effect like Google Play Books

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image is not taking up entire PageSurfaceView

gracejang opened this issue · comments

Hello!

Thank you for sharing your project :) I am having a small problem with the image not taking up the entire surface view with the black border / background of the PageSurfaceView showing. Is there anything I can do to fix this? :) (see screenshot)

screen shot 2016-12-20 at 10 48 39 am

Hi! Thanks for responding :) Where in the library do you think I can make the adjustment? I'm not familiar with OpenGL so any help in the right direction is appreciated!

In Page.java you will find this below method. it's currently considering the bitmap aspect ratio. So if you want to make image to scale and go full screen replace the bitmap ratio with the screen ratio.

public void calculateVerticesCoords(){
		 h_w_ratio = bitmap_ratio;
		 h_w_correction = (h_w_ratio-1f)/2.0f;
}

In Page.java you will find this below method. it's currently considering the bitmap aspect ratio. So if you want to make image to scale and go full screen replace the bitmap ratio with the screen ratio.

public void calculateVerticesCoords(){
		 h_w_ratio = bitmap_ratio;
		 h_w_correction = (h_w_ratio-1f)/2.0f;
}

I have got a worst case. But don't know why! Without any changes, half of the image is cut :
image

If I change h_w_correction, it just goes up and down. And if I change h_w_ratio, the image get bigger, but If I use negative float, it rotates upside down. FYI, I have tried changing width and height of the picture also. But nothing works. Please, your little help will be helpful.