Field editor fixes in Firefox (#284)

* fixing speed field picker

* switching to open sans

* alignment-baseline not support in FF
This commit is contained in:
Peli de Halleux 2018-01-30 20:40:41 -08:00 committed by GitHub
parent 4f70d341e4
commit 8a331648d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 8 deletions

View File

@ -40,7 +40,9 @@ export class FieldSpeed extends Blockly.FieldSlider implements Blockly.FieldCust
var labelContainer = document.createElement('div');
this.speedSVG = document.createElementNS("http://www.w3.org/2000/svg", "svg") as SVGGElement;
pxsim.svg.hydrate(this.speedSVG, {
viewBox: "0 0 200 100"
viewBox: "0 0 200 100",
width: "200",
height: "100"
});
labelContainer.appendChild(this.speedSVG);
@ -58,7 +60,7 @@ export class FieldSpeed extends Blockly.FieldSlider implements Blockly.FieldCust
this.reporter = pxsim.svg.child(this.speedSVG, "text", {
'x': 100, 'y': 80,
'text-anchor': 'middle', 'alignment-baseline': 'middle',
'text-anchor': 'middle', 'dominant-baseline': 'middle',
'style': 'font-size: 50px',
'class': 'sim-text inverted number'
}) as SVGTextElement;

View File

@ -56,7 +56,7 @@ export class FieldTurnRatio extends Blockly.FieldSlider implements Blockly.Field
}, marker);
this.reporter_ = pxsim.svg.child(svg, "text", {
'x': FieldTurnRatio.HALF, 'y': 96,
'text-anchor': 'middle', 'alignment-baseline': 'middle',
'text-anchor': 'middle', 'dominant-baseline': 'middle',
'style': 'font-size: 50px',
'class': 'sim-text inverted number'
}) as SVGTextElement;

View File

@ -23,7 +23,7 @@ namespace pxsim.visuals {
this.reporter = pxsim.svg.child(this.group, "text", {
'x': this.getWidth() / 2, 'y': this.getHeight() / 2,
'text-anchor': 'middle', 'alignment-baseline': 'middle',
'text-anchor': 'middle', 'dominant-baseline': 'middle',
'style': 'font-size: 50px',
'class': 'sim-text inverted number' }) as SVGTextElement;

View File

@ -27,7 +27,7 @@ namespace pxsim.visuals {
this.reporter = pxsim.svg.child(this.group, "text", {
'x': this.getInnerWidth() / 2, 'y': this.getInnerHeight() / 2,
'text-anchor': 'middle', 'alignment-baseline': 'middle',
'text-anchor': 'middle', 'dominant-baseline': 'middle',
'style': 'font-size: 50px',
'class': 'sim-text inverted number'
}) as SVGTextElement;

View File

@ -2,10 +2,10 @@
User Global Variables
*******************************/
@importGoogleFonts: false;
@importGoogleFonts: true;
@headerFont : Roboto,"Arial Narrow","Helvetica Neue",Helvetica,Arial,sans-serif;
@pageFont : Roboto,"Helvetica Neue",Helvetica,Arial,sans-serif;
@headerFont : "Open Sans","Arial Narrow","Helvetica Neue",Helvetica,Arial,sans-serif;
@pageFont : "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
@emSize : 14px;
@fontSize : 13px;