• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] ProgressBar2 on high resolution - [FIXED]
#1
Hi.



I'm using the include https://github.com/Southclaws/progress2 and a small bug is happening.



I could create an issue post in the repository but it was archived by the owner.



On my old monitor the resolution was 1280x720 there was no problem.



My current monitor is 2560x1080 and the following bug is happening when the bar value is less than 5.5:

[Image: Screenshot-229.png]



Here is the function to return the current progress value:

PHP Code:
stock Float:_bar_percent(Float:xFloat:widthorheightFloat:maxFloat:valuedirection)

{

new 
Float:result;

switch(
direction)

{

case 
BAR_DIRECTION_RIGHT:

{

result = ((3.0)  (((((2.0)  widthorheight) - x) / max) * value));

}

case 
BAR_DIRECTION_LEFT:?

{

result = ((1.0) - (((((x  2.0) - widthorheight) - x) / max) * -value)) - 4.0;

}

case 
BAR_DIRECTION_UP:?

{

result = -((((((widthorheight 10.0) - 0.45) * 1.02) / max) * value)  0.55);

}

case 
BAR_DIRECTION_DOWN:?

{

result = ((((((widthorheight 10.0) - 0.45) * 1.02) / max) * value) - 0.55);

}

}

return 
result;





If I change the code
Code:
result = ((x - 3.0)  (((((x - 2.0)  widthorheight) - x) / max) * value));
to
Code:
result = (x  ((((x  widthorheight) - x) / max) * value));



Fix the problem but creates another:

[Image: Screenshot-228.png]







FIXED THE PROBLEM

I made several corrections in the include and managed to solve my problem.

[Image: Screenshot-236.png]



If anyone is interested I'm sharing:?https://github.com/Walter-Correa/progress2
  Reply
#2
FIXED
  Reply


Forum Jump: