-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"inputbox.html" uses CSS zoom incorrectly #1
Comments
hm.. didn't realize it wasn't standard. (https://developer.mozilla.org/en-US/docs/Web/CSS/zoom) I haven't seen a single browser ignore it. Been around for ages. Setting But being non-standard, it's better to avoid it. Real fix would be to regenerate bootstrap CSS with custom sizes. |
It is in SU2016 and IE WebBrowser control that I noticed it has no effect at all. What I ended up doing was just base everything upon the font setting at the top of of tree (html) and then use rem which plays off of that (when I want it to.) Since 1em == 16px, and that is too large I set the size to 0.75 for the content. Oh and I ended up ditching the bootstrap CSS entirely. It was just way too large to even consider understanding for simple dialogs. And I also prefer the XP style buttons rather than flat blue buttons. I just copied what I wanted from the bootstrap rules (borders and hovers styles mostly) and made our own separate CSS files. I just don't have time to learn bootstrap. Take the best, forget the rest. ; ) I also got rid of some of the weird wrapping label & control pairs. Just made issues. |
Okay, I have finally gotten a new machine that can run SU2017+ with a higher DPI display of ~141ppi, and have done some more tests, and compared my dialogs running in The
|
What I did in SUbD to deal with the webdialog sizes I allowed the users to set a scaling factor manually if they where using an older SU version. Here's my DPI utility module that I used: Sketchup::require "TT_SUbD/settings"
module TT::Plugins::SUbD
module Dpi
SKETCHUP_VERSION = Sketchup.version.to_i
def self.scaling_factor
if UI.respond_to?(:scale_factor)
UI.scale_factor
else
Settings.read('MonitorScale', 1.0)
end
end
def self.scale(value)
value * self.scaling_factor
end
def self.scale_line_width(width)
if SKETCHUP_VERSION > 16
# SketchUp 17 scales line weights automatically.
width
else
width * self.scaling_factor
end
end
def self.scale_webdialog(logical_pixels)
if Sketchup.version.to_i > 16
# SketchUp 2017 scales up the position and size automatically for both
# UI::WebDialog and UI::HtmlDialog.
logical_pixels
else
logical_pixels * self.scaling_factor
end
end
def self.get_transform(screen_point)
scale = self.scaling_factor
tr_scale = Geom::Transformation.scaling(scale, scale, scale)
tr_translate = Geom::Transformation.new(screen_point)
tr_translate * tr_scale
end
end # class
end # module |
FYI (and note to self): DPI-related APIs and registry settings |
"inputbox.html" uses CSS zoom incorrectly
In the style element of the file ...
zoom
does not work outside an@viewport
at-rule. It is ignored according to the docs.Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/@viewport
EDIT: (2018-08-31)
After further tests, neither
zoom
nor-ms-zoom
works, outside of a@viewport
rule, inUI::WebDialog
on MS Windows which runs in a MSIE WebBrowser Control.It DOES work in Chromium dialogs, outside of a
@viewport
rule, which is used by theUI::HtmlDialog
class on SU2017 or higher. (This example is only written to use the newUI::HtmlDialog
class, so the lack ofzoom
working in aUI::WebDialog
may not be considered a bug for this example.)Also tested the following in a MSIE
UI::WebDialog
and it also does NOT work.The text was updated successfully, but these errors were encountered: