Skip to content

Instantly share code, notes, and snippets.

@bilke
Created May 31, 2016 06:45
Show Gist options
  • Select an option

  • Save bilke/499364a4822a52203a6168497f8d62f3 to your computer and use it in GitHub Desktop.

Select an option

Save bilke/499364a4822a52203a6168497f8d62f3 to your computer and use it in GitHub Desktop.
diff --git a/public/src/ui_builder.js b/public/src/ui_builder.js
index 431bcb0..4ff6716 100755
--- a/public/src/ui_builder.js
+++ b/public/src/ui_builder.js
@@ -267,6 +267,13 @@ function UIBuilder(json_cfg, clientID) {
// Calculate offsets for borders
var borderx = (x + 1) * this.json_cfg.resolution.borders.left + x * this.json_cfg.resolution.borders.right;
var bordery = (y + 1) * this.json_cfg.resolution.borders.top + y * this.json_cfg.resolution.borders.bottom;
+
+ if (this.json_cfg.dimensions.tile_overlap.horizontal != 0 ||
+ this.json_cfg.dimensions.tile_overlap.vertical != 0) {
+ borderx = this.json_cfg.dimensions.tile_overlap.horizontal * x * -1;
+ bordery = this.json_cfg.dimensions.tile_overlap.vertical * y * -1;
+ }
+
// Position offsets plus borders offsets
this.offsetX = x * this.json_cfg.resolution.width + borderx;
this.offsetY = y * this.json_cfg.resolution.height + bordery;
diff --git a/server.js b/server.js
index 50016a8..ee7a6a2 100755
--- a/server.js
+++ b/server.js
@@ -3345,6 +3345,9 @@ function loadConfiguration() {
if (userConfig.dimensions === undefined) {
userConfig.dimensions = {};
}
+ if (userConfig.dimensions.tile_overlap === undefined) {
+ userConfig.dimensions.tile_overlap = { horizontal: 0, vertical: 0 };
+ }
if (userConfig.dimensions.tile_borders === undefined) {
// set default values to 0
// first for pixel sizes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment