This is a migrated thread and some comments may be shown as answers.

TelerikDpiHelper.ScaleSize returns negative values

1 Answer 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 24 Jan 2019, 04:30 PM

Hello there. 

This code returns negative MaxSize on 100% dpi, since it overflows int.

var dpiScaleFactor = radLabel1.RootElement.DpiScaleFactor;
var r1 = new Size(150, int.MaxValue);
var r2 = TelerikDpiHelper.ScaleSize(r1, new SizeF(1f / dpiScaleFactor.Width, 1f / dpiScaleFactor.Height));

I use that code to descale some sizes on runtime per suggestion on the forum, also I have seen similar code in Telerik sources. When control receives negative max size it becomes invisible. You may want to investigate this cases. 

I use Telerik 2018.3.1016.20 with .Net 3.5 on Server 2008 R2 SP1.

Best regards.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 25 Jan 2019, 09:58 AM
Hello Jeremy,

Thank you for reporting this. We will consider your feedback. 

Please note that it is not common to use Int.MaxValue for size, if you do not want to set maximum height just use 0 instead.

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or