It is currently Sun Aug 25, 2019 12:05 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: PB 5.70 - DesktopScaled Bug
PostPosted: Thu Dec 06, 2018 2:30 am 
Offline
User
User

Joined: Sun Aug 02, 2015 7:17 pm
Posts: 16
Code:
;%125
dpi = 96*1.25

; =913
Debug MulDiv_(730, dpi, 96)

; =912
Debug DesktopScaledX(730)


It's 1 pixel less than normal


Top
 Profile  
Reply with quote  
 Post subject: Re: PB 5.70 - DesktopScaled Bug
PostPosted: Wed Jan 30, 2019 11:13 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3640
Location: Berlin, Germany
730 * 120 / 96 = 912.5

MulDiv_() rounds the result up.
DesktopScaledX() rounds the result down.
I'd hardly call that a bug.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: PB 5.70 - DesktopScaled Bug
PostPosted: Wed Jan 30, 2019 11:37 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 609
It should have an optional round parameter or follow muldiv() wich is everyione uses.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB 5.70 - DesktopScaled Bug
PostPosted: Wed Jan 30, 2019 1:42 pm 
Offline
User
User

Joined: Sun Aug 02, 2015 7:17 pm
Posts: 16
Justin wrote:
It should have an optional round parameter or follow muldiv() wich is everyione uses.

:lol: MulDiv is Microsoft's approach


Top
 Profile  
Reply with quote  
 Post subject: Re: PB 5.70 - DesktopScaled Bug
PostPosted: Wed Jan 30, 2019 3:41 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 609
Exactly, and it's what the os uses when automatically scales fonts and windows.

Try to get the scaled os system font height, the pb function fails because it rounds down.

But the best alternative is add an optional round parameter, rounding up or down makes difference and should be up to the programmer what to use.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB 5.70 - DesktopScaled Bug
PostPosted: Thu Jan 31, 2019 8:48 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3640
Location: Berlin, Germany
diskay wrote:
:lol: MulDiv is Microsoft's approach

Justin wrote:
Exactly, and it's what the os uses when automatically scales fonts and windows.

I see. That makes sense.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: PB 5.70 - DesktopScaled Bug
PostPosted: Tue Feb 05, 2019 9:28 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 609
Spam?


Top
 Profile  
Reply with quote  
 Post subject: Re: PB 5.70 - DesktopScaled Bug
PostPosted: Fri May 03, 2019 4:37 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 06, 2006 4:41 am
Posts: 671
Location: Canada
Justin wrote:
Spam?

Why do you write this ?

_________________
"That's not a bug..." said the programmer. "...It's a feature! "
"Oh! I see..." replied the blind man.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB 5.70 - DesktopScaled Bug
PostPosted: Fri May 03, 2019 8:25 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 609
Because there was a spam post that has been deleted.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB 5.70 - DesktopScaled Bug
PostPosted: Fri May 03, 2019 8:54 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 06, 2006 4:41 am
Posts: 671
Location: Canada
Merci.

_________________
"That's not a bug..." said the programmer. "...It's a feature! "
"Oh! I see..." replied the blind man.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye