mirror of https://github.com/CesiumGS/cesium.git
Compare commits
6 Commits
70372805bc
...
bf08019553
| Author | SHA1 | Date |
|---|---|---|
|
|
bf08019553 | |
|
|
ee2b3813b2 | |
|
|
4e3980cc53 | |
|
|
2d0e881db0 | |
|
|
b8ee60182e | |
|
|
e87a069808 |
|
|
@ -7,7 +7,8 @@
|
||||||
#### Fixes :wrench:
|
#### Fixes :wrench:
|
||||||
|
|
||||||
- Billboards using `imageSubRegion` now render as expected. [#12585](https://github.com/CesiumGS/cesium/issues/12585)
|
- Billboards using `imageSubRegion` now render as expected. [#12585](https://github.com/CesiumGS/cesium/issues/12585)
|
||||||
- Improved scaling of SVGs in billboards [#TODO](https://github.com/CesiumGS/cesium/issues/TODO)
|
- Improved scaling of SVGs in billboards [#13020](https://github.com/CesiumGS/cesium/issues/13020)
|
||||||
|
- Fixed unexpected outline artifacts around billboards [#13038](https://github.com/CesiumGS/cesium/issues/13038)
|
||||||
|
|
||||||
#### Additions :tada:
|
#### Additions :tada:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
import { defineConfig, devices } from "@playwright/test";
|
import { defineConfig, devices } from "@playwright/test";
|
||||||
import yargs from "yargs";
|
import yargs from "yargs";
|
||||||
|
|
||||||
const argv = yargs(process.argv).options({
|
const argv = yargs(process.argv)
|
||||||
"update-snapshots": {
|
.options({
|
||||||
alias: "u",
|
"update-snapshots": {
|
||||||
description: "Update test snapshots.",
|
alias: "u",
|
||||||
type: "boolean",
|
description: "Update test snapshots.",
|
||||||
default: false,
|
type: "boolean",
|
||||||
},
|
default: false,
|
||||||
}).argv;
|
},
|
||||||
|
})
|
||||||
|
.parse();
|
||||||
|
|
||||||
const baseUrl = `http://localhost:3000`;
|
const baseUrl = `http://localhost:3000`;
|
||||||
const updateSnapshots = argv["update-snapshots"];
|
const updateSnapshots = argv["update-snapshots"];
|
||||||
|
|
@ -53,10 +55,11 @@ export default defineConfig({
|
||||||
name: "chromium",
|
name: "chromium",
|
||||||
use: {
|
use: {
|
||||||
...devices["Desktop Chrome"],
|
...devices["Desktop Chrome"],
|
||||||
|
channel: "chromium",
|
||||||
viewport: defaultViewport,
|
viewport: defaultViewport,
|
||||||
launchOptions: {
|
launchOptions: {
|
||||||
// this forces chrome to use the gpu for webgl which greatly speeds up tests
|
// this forces chrome to use the gpu for webgl which greatly speeds up tests
|
||||||
args: ["--use-angle=gl"],
|
args: ["--use-angle=gl", "--enable-features=Vulkan"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ const noDevelopmentGallery =
|
||||||
taskName === "release" ||
|
taskName === "release" ||
|
||||||
taskName === "makeZip" ||
|
taskName === "makeZip" ||
|
||||||
taskName === "websiteRelease";
|
taskName === "websiteRelease";
|
||||||
const argv = yargs(process.argv).argv;
|
const argv = yargs(process.argv).parse();
|
||||||
const verbose = argv.verbose;
|
const verbose = argv.verbose;
|
||||||
|
|
||||||
const sourceFiles = [
|
const sourceFiles = [
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@cesium/eslint-config": "^12.0.0",
|
"@cesium/eslint-config": "^12.0.0",
|
||||||
"@playwright/test": "^1.41.1",
|
"@playwright/test": "^1.52.0",
|
||||||
"chokidar": "^4.0.1",
|
"chokidar": "^4.0.1",
|
||||||
"cloc": "^2.6.0-cloc",
|
"cloc": "^2.6.0-cloc",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,8 @@ TexturePacker.prototype._findNode = function (node, { width, height }) {
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const borderPadding = this._borderPadding;
|
||||||
|
|
||||||
// Vertical split (childNode1 = left half, childNode2 = right half).
|
// Vertical split (childNode1 = left half, childNode2 = right half).
|
||||||
if (widthDifference > heightDifference) {
|
if (widthDifference > heightDifference) {
|
||||||
node.childNode1 = new TextureNode({
|
node.childNode1 = new TextureNode({
|
||||||
|
|
@ -130,12 +132,18 @@ TexturePacker.prototype._findNode = function (node, { width, height }) {
|
||||||
width,
|
width,
|
||||||
height: nodeHeight,
|
height: nodeHeight,
|
||||||
});
|
});
|
||||||
node.childNode2 = new TextureNode({
|
|
||||||
x: rectangle.x + width,
|
// Apply padding only along the vertical "cut".
|
||||||
y: rectangle.y,
|
const widthDifferencePadded = widthDifference - borderPadding;
|
||||||
width: widthDifference,
|
|
||||||
height: nodeHeight,
|
if (widthDifferencePadded > 0) {
|
||||||
});
|
node.childNode2 = new TextureNode({
|
||||||
|
x: rectangle.x + width + borderPadding,
|
||||||
|
y: rectangle.y,
|
||||||
|
width: widthDifferencePadded,
|
||||||
|
height: nodeHeight,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return this._findNode(node.childNode1, { width, height });
|
return this._findNode(node.childNode1, { width, height });
|
||||||
}
|
}
|
||||||
|
|
@ -147,12 +155,19 @@ TexturePacker.prototype._findNode = function (node, { width, height }) {
|
||||||
width: nodeWidth,
|
width: nodeWidth,
|
||||||
height,
|
height,
|
||||||
});
|
});
|
||||||
node.childNode2 = new TextureNode({
|
|
||||||
x: rectangle.x,
|
// Apply padding only along the horizontal "cut".
|
||||||
y: rectangle.y + height,
|
const heightDifferencePadded = heightDifference - borderPadding;
|
||||||
width: nodeWidth,
|
|
||||||
height: heightDifference,
|
if (heightDifferencePadded > 0) {
|
||||||
});
|
node.childNode2 = new TextureNode({
|
||||||
|
x: rectangle.x,
|
||||||
|
y: rectangle.y + height + borderPadding,
|
||||||
|
width: nodeWidth,
|
||||||
|
height: heightDifferencePadded,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return this._findNode(node.childNode1, { width, height });
|
return this._findNode(node.childNode1, { width, height });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -852,16 +852,16 @@ describe("Scene/TextureAtlas", function () {
|
||||||
.2222222222222222...............
|
.2222222222222222...............
|
||||||
.2222222222222222...............
|
.2222222222222222...............
|
||||||
.2222222222222222...............
|
.2222222222222222...............
|
||||||
.22222222222222223333333333.....
|
.2222222222222222.3333333333....
|
||||||
.22222222222222223333333333.....
|
.2222222222222222.3333333333....
|
||||||
.22222222222222223333333333.....
|
.2222222222222222.3333333333....
|
||||||
.22222222222222223333333333.....
|
.2222222222222222.3333333333....
|
||||||
.22222222222222223333333333.....
|
.2222222222222222.3333333333....
|
||||||
.22222222222222223333333333.....
|
.2222222222222222.3333333333....
|
||||||
.22222222222222223333333333.....
|
.2222222222222222.3333333333....
|
||||||
.22222222222222223333333333.....
|
.2222222222222222.3333333333.1..
|
||||||
.22222222222222223333333333.....
|
.2222222222222222.3333333333....
|
||||||
.2222222222222222333333333301...
|
.2222222222222222.3333333333.0..
|
||||||
................................
|
................................
|
||||||
`.trim(),
|
`.trim(),
|
||||||
);
|
);
|
||||||
|
|
@ -926,9 +926,9 @@ describe("Scene/TextureAtlas", function () {
|
||||||
.2222222222...
|
.2222222222...
|
||||||
.2222222222...
|
.2222222222...
|
||||||
.2222222222...
|
.2222222222...
|
||||||
|
.2222222222.1.
|
||||||
.2222222222...
|
.2222222222...
|
||||||
.2222222222...
|
.2222222222.0.
|
||||||
.222222222201.
|
|
||||||
..............
|
..............
|
||||||
`.trim(),
|
`.trim(),
|
||||||
);
|
);
|
||||||
|
|
@ -976,16 +976,16 @@ describe("Scene/TextureAtlas", function () {
|
||||||
.3333333333333333...............
|
.3333333333333333...............
|
||||||
.3333333333333333...............
|
.3333333333333333...............
|
||||||
.3333333333333333...............
|
.3333333333333333...............
|
||||||
.33333333333333332222222222.....
|
.3333333333333333.2222222222....
|
||||||
.33333333333333332222222222.....
|
.3333333333333333.2222222222....
|
||||||
.33333333333333332222222222.....
|
.3333333333333333.2222222222....
|
||||||
.33333333333333332222222222.....
|
.3333333333333333.2222222222....
|
||||||
.33333333333333332222222222.....
|
.3333333333333333.2222222222....
|
||||||
.33333333333333332222222222.....
|
.3333333333333333.2222222222....
|
||||||
.33333333333333332222222222.....
|
.3333333333333333.2222222222....
|
||||||
.33333333333333332222222222.....
|
.3333333333333333.2222222222.1..
|
||||||
.33333333333333332222222222.....
|
.3333333333333333.2222222222....
|
||||||
.3333333333333333222222222201...
|
.3333333333333333.2222222222.0..
|
||||||
................................
|
................................
|
||||||
`.trim(),
|
`.trim(),
|
||||||
);
|
);
|
||||||
|
|
@ -1337,6 +1337,108 @@ describe("Scene/TextureAtlas", function () {
|
||||||
).contextToRender([0, 255, 0, 255]);
|
).contextToRender([0, 255, 0, 255]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("adds custom padding with borderWidthInPixels", async function () {
|
||||||
|
atlas = new TextureAtlas({ borderWidthInPixels: 0 });
|
||||||
|
let indices = await addImages();
|
||||||
|
|
||||||
|
expect(drawAtlas(atlas, indices)).toBe(
|
||||||
|
`
|
||||||
|
................
|
||||||
|
................
|
||||||
|
................
|
||||||
|
................
|
||||||
|
................
|
||||||
|
................
|
||||||
|
2222222222......
|
||||||
|
2222222222......
|
||||||
|
2222222222......
|
||||||
|
2222222222......
|
||||||
|
2222222222......
|
||||||
|
2222222222......
|
||||||
|
22222222220.....
|
||||||
|
22222222220.....
|
||||||
|
22222222220.....
|
||||||
|
222222222201....
|
||||||
|
`.trim(),
|
||||||
|
);
|
||||||
|
|
||||||
|
atlas = new TextureAtlas({ borderWidthInPixels: 2 });
|
||||||
|
indices = await addImages();
|
||||||
|
|
||||||
|
expect(drawAtlas(atlas, indices)).toBe(
|
||||||
|
`
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
..2222222222....................
|
||||||
|
..2222222222....................
|
||||||
|
..2222222222....................
|
||||||
|
..2222222222..1.................
|
||||||
|
..2222222222....................
|
||||||
|
..2222222222....................
|
||||||
|
..2222222222..0.................
|
||||||
|
..2222222222..0.................
|
||||||
|
..2222222222..0.................
|
||||||
|
..2222222222..0.................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
`.trim(),
|
||||||
|
);
|
||||||
|
|
||||||
|
atlas = new TextureAtlas({ borderWidthInPixels: 5 });
|
||||||
|
indices = await addImages();
|
||||||
|
|
||||||
|
expect(drawAtlas(atlas, indices)).toBe(
|
||||||
|
`
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
.....2222222222.................
|
||||||
|
.....2222222222.................
|
||||||
|
.....2222222222.................
|
||||||
|
.....2222222222.................
|
||||||
|
.....2222222222.................
|
||||||
|
.....2222222222.................
|
||||||
|
.....2222222222.....0...........
|
||||||
|
.....2222222222.....0...........
|
||||||
|
.....2222222222.....0...........
|
||||||
|
.....2222222222.....0.....1.....
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
................................
|
||||||
|
`.trim(),
|
||||||
|
);
|
||||||
|
|
||||||
|
async function addImages() {
|
||||||
|
const promise = Promise.all([
|
||||||
|
atlas.addImage(tallGreenGuid, tallGreenImage),
|
||||||
|
atlas.addImage(blueGuid, blueImage),
|
||||||
|
atlas.addImage(bigBlueGuid, bigBlueImage),
|
||||||
|
]);
|
||||||
|
|
||||||
|
return pollWhilePromise(promise, () => {
|
||||||
|
atlas.update(scene.frameState.context);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
it("GUID changes when atlas texure is modified", async function () {
|
it("GUID changes when atlas texure is modified", async function () {
|
||||||
atlas = new TextureAtlas();
|
atlas = new TextureAtlas();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,8 @@ const argv = yargs(process.argv)
|
||||||
description: "If true, skip build step and serve existing built files.",
|
description: "If true, skip build step and serve existing built files.",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.help().argv;
|
.help()
|
||||||
|
.parse();
|
||||||
|
|
||||||
// These functions will not exist in the production zip file but they also won't be run
|
// These functions will not exist in the production zip file but they also won't be run
|
||||||
const { getSandcastleConfig, buildSandcastleGallery, buildSandcastleApp } =
|
const { getSandcastleConfig, buildSandcastleGallery, buildSandcastleApp } =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue