Commit 29976c4c authored by Neil Fraser's avatar Neil Fraser

Remove outside border from Blockly (issue 92).

parent 3122c8a9
This diff is collapsed.
...@@ -134,7 +134,6 @@ Blockly.Css.setCursor = function(cursor) { ...@@ -134,7 +134,6 @@ Blockly.Css.setCursor = function(cursor) {
Blockly.Css.CONTENT = [ Blockly.Css.CONTENT = [
'.blocklySvg {', '.blocklySvg {',
' background-color: #fff;', ' background-color: #fff;',
' border: 1px solid #ddd;',
' overflow: hidden;', /* IE overflows by default. */ ' overflow: hidden;', /* IE overflows by default. */
'}', '}',
...@@ -315,6 +314,8 @@ Blockly.Css.CONTENT = [ ...@@ -315,6 +314,8 @@ Blockly.Css.CONTENT = [
'.blocklyMainBackground {', '.blocklyMainBackground {',
' fill: url(#blocklyGridPattern);', ' fill: url(#blocklyGridPattern);',
' stroke-width: 1;',
' stroke: #c6c6c6;', /* Equates to #ddd due to border being off-pixel. */
'}', '}',
'.blocklyMutatorBackground {', '.blocklyMutatorBackground {',
......
...@@ -44,7 +44,7 @@ Blockly.ScrollbarPair = function(workspace) { ...@@ -44,7 +44,7 @@ Blockly.ScrollbarPair = function(workspace) {
this.corner_ = Blockly.createSvgElement('rect', this.corner_ = Blockly.createSvgElement('rect',
{'height': Blockly.Scrollbar.scrollbarThickness, {'height': Blockly.Scrollbar.scrollbarThickness,
'width': Blockly.Scrollbar.scrollbarThickness, 'width': Blockly.Scrollbar.scrollbarThickness,
'style': 'fill: #fff'}, null); 'class': 'blocklyScrollbarBackground'}, null);
Blockly.Scrollbar.insertAfter_(this.corner_, workspace.getBubbleCanvas()); Blockly.Scrollbar.insertAfter_(this.corner_, workspace.getBubbleCanvas());
}; };
...@@ -158,14 +158,14 @@ Blockly.Scrollbar = function(workspace, horizontal, opt_pair) { ...@@ -158,14 +158,14 @@ Blockly.Scrollbar = function(workspace, horizontal, opt_pair) {
this.svgBackground_.setAttribute('height', this.svgBackground_.setAttribute('height',
Blockly.Scrollbar.scrollbarThickness); Blockly.Scrollbar.scrollbarThickness);
this.svgKnob_.setAttribute('height', this.svgKnob_.setAttribute('height',
Blockly.Scrollbar.scrollbarThickness - 6); Blockly.Scrollbar.scrollbarThickness - 5);
this.svgKnob_.setAttribute('y', 3); this.svgKnob_.setAttribute('y', 2.5);
} else { } else {
this.svgBackground_.setAttribute('width', this.svgBackground_.setAttribute('width',
Blockly.Scrollbar.scrollbarThickness); Blockly.Scrollbar.scrollbarThickness);
this.svgKnob_.setAttribute('width', this.svgKnob_.setAttribute('width',
Blockly.Scrollbar.scrollbarThickness - 6); Blockly.Scrollbar.scrollbarThickness - 5);
this.svgKnob_.setAttribute('x', 3); this.svgKnob_.setAttribute('x', 2.5);
} }
var scrollbar = this; var scrollbar = this;
this.onMouseDownBarWrapper_ = Blockly.bindEvent_(this.svgBackground_, this.onMouseDownBarWrapper_ = Blockly.bindEvent_(this.svgBackground_,
...@@ -235,7 +235,7 @@ Blockly.Scrollbar.prototype.resize = function(opt_metrics) { ...@@ -235,7 +235,7 @@ Blockly.Scrollbar.prototype.resize = function(opt_metrics) {
* .absoluteLeft: Left-edge of view. * .absoluteLeft: Left-edge of view.
*/ */
if (this.horizontal_) { if (this.horizontal_) {
var outerLength = hostMetrics.viewWidth; var outerLength = hostMetrics.viewWidth - 1;
if (this.pair_) { if (this.pair_) {
// Shorten the scrollbar to make room for the corner square. // Shorten the scrollbar to make room for the corner square.
outerLength -= Blockly.Scrollbar.scrollbarThickness; outerLength -= Blockly.Scrollbar.scrollbarThickness;
...@@ -254,19 +254,19 @@ Blockly.Scrollbar.prototype.resize = function(opt_metrics) { ...@@ -254,19 +254,19 @@ Blockly.Scrollbar.prototype.resize = function(opt_metrics) {
var innerOffset = (hostMetrics.viewLeft - hostMetrics.contentLeft) * var innerOffset = (hostMetrics.viewLeft - hostMetrics.contentLeft) *
this.ratio_; this.ratio_;
this.svgKnob_.setAttribute('width', Math.max(0, innerLength)); this.svgKnob_.setAttribute('width', Math.max(0, innerLength));
this.xCoordinate = hostMetrics.absoluteLeft; this.xCoordinate = hostMetrics.absoluteLeft + 0.5;
if (this.pair_ && Blockly.RTL) { if (this.pair_ && Blockly.RTL) {
this.xCoordinate += hostMetrics.absoluteLeft + this.xCoordinate += hostMetrics.absoluteLeft +
Blockly.Scrollbar.scrollbarThickness; Blockly.Scrollbar.scrollbarThickness;
} }
this.yCoordinate = hostMetrics.absoluteTop + hostMetrics.viewHeight - this.yCoordinate = hostMetrics.absoluteTop + hostMetrics.viewHeight -
Blockly.Scrollbar.scrollbarThickness; Blockly.Scrollbar.scrollbarThickness - 0.5;
this.svgGroup_.setAttribute('transform', this.svgGroup_.setAttribute('transform',
'translate(' + this.xCoordinate + ', ' + this.yCoordinate + ')'); 'translate(' + this.xCoordinate + ', ' + this.yCoordinate + ')');
this.svgBackground_.setAttribute('width', Math.max(0, outerLength)); this.svgBackground_.setAttribute('width', Math.max(0, outerLength));
this.svgKnob_.setAttribute('x', this.constrainKnob_(innerOffset)); this.svgKnob_.setAttribute('x', this.constrainKnob_(innerOffset));
} else { } else {
var outerLength = hostMetrics.viewHeight; var outerLength = hostMetrics.viewHeight - 1;
if (this.pair_) { if (this.pair_) {
// Shorten the scrollbar to make room for the corner square. // Shorten the scrollbar to make room for the corner square.
outerLength -= Blockly.Scrollbar.scrollbarThickness; outerLength -= Blockly.Scrollbar.scrollbarThickness;
...@@ -283,12 +283,12 @@ Blockly.Scrollbar.prototype.resize = function(opt_metrics) { ...@@ -283,12 +283,12 @@ Blockly.Scrollbar.prototype.resize = function(opt_metrics) {
var innerOffset = (hostMetrics.viewTop - hostMetrics.contentTop) * var innerOffset = (hostMetrics.viewTop - hostMetrics.contentTop) *
this.ratio_; this.ratio_;
this.svgKnob_.setAttribute('height', Math.max(0, innerLength)); this.svgKnob_.setAttribute('height', Math.max(0, innerLength));
this.xCoordinate = hostMetrics.absoluteLeft; this.xCoordinate = hostMetrics.absoluteLeft + 0.5;
if (!Blockly.RTL) { if (!Blockly.RTL) {
this.xCoordinate += hostMetrics.viewWidth - this.xCoordinate += hostMetrics.viewWidth -
Blockly.Scrollbar.scrollbarThickness; Blockly.Scrollbar.scrollbarThickness - 1;
} }
this.yCoordinate = hostMetrics.absoluteTop; this.yCoordinate = hostMetrics.absoluteTop + 0.5;
this.svgGroup_.setAttribute('transform', this.svgGroup_.setAttribute('transform',
'translate(' + this.xCoordinate + ', ' + this.yCoordinate + ')'); 'translate(' + this.xCoordinate + ', ' + this.yCoordinate + ')');
this.svgBackground_.setAttribute('height', Math.max(0, outerLength)); this.svgBackground_.setAttribute('height', Math.max(0, outerLength));
...@@ -307,13 +307,13 @@ Blockly.Scrollbar.prototype.createDom_ = function() { ...@@ -307,13 +307,13 @@ Blockly.Scrollbar.prototype.createDom_ = function() {
/* Create the following DOM: /* Create the following DOM:
<g> <g>
<rect class="blocklyScrollbarBackground" /> <rect class="blocklyScrollbarBackground" />
<rect class="blocklyScrollbarKnob" rx="7" ry="7" /> <rect class="blocklyScrollbarKnob" rx="8" ry="8" />
</g> </g>
*/ */
this.svgGroup_ = Blockly.createSvgElement('g', {}, null); this.svgGroup_ = Blockly.createSvgElement('g', {}, null);
this.svgBackground_ = Blockly.createSvgElement('rect', this.svgBackground_ = Blockly.createSvgElement('rect',
{'class': 'blocklyScrollbarBackground'}, this.svgGroup_); {'class': 'blocklyScrollbarBackground'}, this.svgGroup_);
var radius = Math.floor((Blockly.Scrollbar.scrollbarThickness - 6) / 2); var radius = Math.floor((Blockly.Scrollbar.scrollbarThickness - 5) / 2);
this.svgKnob_ = Blockly.createSvgElement('rect', this.svgKnob_ = Blockly.createSvgElement('rect',
{'class': 'blocklyScrollbarKnob', 'rx': radius, 'ry': radius}, {'class': 'blocklyScrollbarKnob', 'rx': radius, 'ry': radius},
this.svgGroup_); this.svgGroup_);
......
...@@ -151,7 +151,7 @@ Blockly.Toolbox.prototype.position_ = function() { ...@@ -151,7 +151,7 @@ Blockly.Toolbox.prototype.position_ = function() {
} else { } else {
treeDiv.style.marginLeft = svgBox.left; treeDiv.style.marginLeft = svgBox.left;
} }
treeDiv.style.height = (svgSize.height + 1) + 'px'; treeDiv.style.height = svgSize.height + 'px';
this.width = treeDiv.offsetWidth; this.width = treeDiv.offsetWidth;
if (!Blockly.RTL) { if (!Blockly.RTL) {
// For some reason the LTR toolbox now reports as 1px too wide. // For some reason the LTR toolbox now reports as 1px too wide.
......
...@@ -39,9 +39,7 @@ ...@@ -39,9 +39,7 @@
position: fixed; position: fixed;
} }
#previewFrame { #previewFrame {
border-style: solid; border: none;
border-color: #ddd;
border-width: 0 1px 1px 0;
position: absolute; position: absolute;
} }
pre { pre {
......
...@@ -68,6 +68,7 @@ h1 { ...@@ -68,6 +68,7 @@ h1 {
/* Tabs */ /* Tabs */
#tabRow>td { #tabRow>td {
border: 1px solid #ccc; border: 1px solid #ccc;
border-bottom: none;
} }
td.tabon { td.tabon {
border-bottom-color: #ddd !important; border-bottom-color: #ddd !important;
...@@ -117,6 +118,7 @@ td { ...@@ -117,6 +118,7 @@ td {
direction: ltr; direction: ltr;
} }
pre.content { pre.content {
border: 1px solid #ccc;
overflow: scroll; overflow: scroll;
} }
#content_blocks { #content_blocks {
...@@ -128,7 +130,7 @@ pre.content { ...@@ -128,7 +130,7 @@ pre.content {
#content_xml { #content_xml {
resize: none; resize: none;
outline: none; outline: none;
border: none; border: 1px solid #ccc;
font-family: monospace; font-family: monospace;
overflow: scroll; overflow: scroll;
} }
......
...@@ -20,9 +20,7 @@ ...@@ -20,9 +20,7 @@
iframe { iframe {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-style: solid; border: none;
border-color: #ddd;
border-width: 0 1px 1px 0;
} }
</style> </style>
</head> </head>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment