You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
Currently, it's impossible to scale sizes specified with in px-units, e.g.: text-size: 13 will be always 13 at any dpi/ppi. While this is similar to how browsers treat px-sizes (at least before retina-displays era), for maps this would mean that scaling is not possible at all.
What I suggest is to consider a change which would allow for px-scaling. A quick patch:
diff --git a/lib/carto/tree/dimension.js b/lib/carto/tree/dimension.js
index 07232f2..7d762ee 100644
--- a/lib/carto/tree/dimension.js+++ b/lib/carto/tree/dimension.js@@ -11,7 +11,7 @@ tree.Dimension = function Dimension(value, unit, index) {
tree.Dimension.prototype = {
is: 'float',
- physical_units: ['m', 'cm', 'in', 'mm', 'pt', 'pc'],+ physical_units: ['m', 'cm', 'in', 'mm', 'pt', 'pc', 'px'],
screen_units: ['px', '%'],
all_units: ['m', 'cm', 'in', 'mm', 'pt', 'pc', 'px', '%'],
densities: {
@@ -19,7 +19,8 @@ tree.Dimension.prototype = {
mm: 25.4,
cm: 2.54,
pt: 72,
- pc: 6+ pc: 6,+ px: 90.714 // the same as the default ppi
},
ev: function (env) {
if (this.unit && !_.contains(this.all_units, this.unit)) {
This behavior is not necessary to trigger by default, instead a command-line switch can be added.
Thoughts?
The text was updated successfully, but these errors were encountered:
and if you change 180 to 180pt (or other unit), you'll get a recursion with 46 iterations, where the value is changing with every step starting from 180.
Initial Value: 180
New value: 250
Initial Value: 250
New value: 275.59
Initial Value: 275.59
New value: 303.8
Initial Value: 303.8
New value: 334.9
Initial Value: 334.9
New value: 369.18
Initial Value: 369.18
New value: 406.97
Currently, it's impossible to scale sizes specified with in px-units, e.g.:
text-size: 13
will be always 13 at any dpi/ppi. While this is similar to how browsers treat px-sizes (at least before retina-displays era), for maps this would mean that scaling is not possible at all.What I suggest is to consider a change which would allow for px-scaling. A quick patch:
This behavior is not necessary to trigger by default, instead a command-line switch can be added.
Thoughts?
The text was updated successfully, but these errors were encountered: