Skip to content

Commit add81ca

Browse files
committed
docs(gallery): tweak examples and screenshots
minor change to improve the example screenshot
1 parent bf4da39 commit add81ca

File tree

7 files changed

+19
-2
lines changed

7 files changed

+19
-2
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ The vtk.js documentation is part of the code repository and is entirely written
128128

129129
If you create an example, please list it in the [examples landing page](Documentation/content/examples/index.md).
130130

131-
Images and GIF videos added to the [gallery](Documentation/public/gallery) must be compressed as much as possible (e.g. 432px by 300px with 50% JPEG compression). You may want to use [ezgif.com](https://ezgif.com/).
131+
Images and GIF videos added to the [gallery](Documentation/public/gallery) must be compressed as much as possible (e.g. 500px by 280px with 50% JPEG compression). You may want to use [ezgif.com](https://ezgif.com/).
132132

133133
## Reporting Issues
134134

-10.5 KB
Loading
-7.26 KB
Loading
-23.4 KB
Loading
-84.2 KB
Loading
-59.4 KB
Loading

Sources/Rendering/Core/TextActor/example/index.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const renderWindow = fullScreenRenderer.getRenderWindow();
2222

2323
const actor = vtkTextActor.newInstance();
2424
actor.setInput('Hello World!');
25-
actor.setDisplayPosition(20, 30);
25+
actor.setDisplayPosition(window.innerWidth / 4, window.innerHeight / 4);
2626

2727
renderer.addActor2D(actor);
2828
renderer.resetCamera();
@@ -35,6 +35,8 @@ renderWindow.render();
3535
const gui = new GUI();
3636
const params = {
3737
text: 'Hello World!',
38+
x: window.innerWidth / 4,
39+
y: window.innerHeight / 4,
3840
};
3941

4042
gui
@@ -44,6 +46,21 @@ gui
4446
actor.setInput(value);
4547
renderWindow.render();
4648
});
49+
gui
50+
.add(params, 'x')
51+
.name('X Position')
52+
.onChange((value) => {
53+
actor.setDisplayPosition(value, params.y);
54+
renderWindow.render();
55+
});
56+
gui
57+
.add(params, 'y')
58+
.name('Y Position')
59+
.onChange((value) => {
60+
actor.setDisplayPosition(params.x, value);
61+
renderWindow.render();
62+
});
63+
4764
global.actor = actor;
4865
global.renderer = renderer;
4966
global.renderWindow = renderWindow;

0 commit comments

Comments
 (0)