Skip to content
Snippets Groups Projects
Commit 68f3be93 authored by jojohoch's avatar jojohoch
Browse files

Prevent scrollbars from displaying for Geogebra elements with fixed size

parent 4ae3083e
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,10 @@ declare const GGBApplet: any;
@Component({
selector: 'aspect-geometry',
template: `
<div class="geogebra-container">
<div class="geogebra-container"
[style.height.px]="elementModel.height"
[style.width.px]="elementModel.width"
[class.center]="this.elementModel.position.fixedSize && this.elementModel.position.dynamicPositioning">
<div [id]="elementModel.id" class="geogebra-applet"></div>
<button *ngIf="this.elementModel.showResetIcon"
mat-icon-button
......@@ -27,8 +30,8 @@ declare const GGBApplet: any;
`,
styles: [
':host {display: block; width: 100%; height: 100%;}',
'.geogebra-applet {margin: auto;}',
'.geogebra-container {position: relative;}',
'.center {margin: auto;}',
'.reset-button {position: absolute; right: 0; z-index: 100; margin: 5px;}',
'.reset-icon {font-size: 30px !important;}'
]
......@@ -86,8 +89,9 @@ export class GeometryComponent extends ElementComponent implements AfterViewInit
}
const params: any = {
id: this.elementModel.id,
width: this.elementModel.width,
height: this.elementModel.height,
width: this.elementModel.width - 4, // must be smaller than the container, otherwise scroll bars will be displayed
height: this.elementModel.height - 4,
scale: 1,
showToolBar: this.elementModel.showToolbar,
enableShiftDragZoom: this.elementModel.enableShiftDragZoom,
showZoomButtons: this.elementModel.showZoomButtons,
......
......@@ -31,7 +31,7 @@ export class GeometryElement extends UIElement implements PositionedUIElement {
this.showFullscreenButton = element.showFullscreenButton !== undefined ? element.showFullscreenButton : true;
this.customToolBar = element.customToolBar !== undefined ? element.customToolBar : '';
this.position = UIElement.initPositionProps({ ...element.position, fixedSize: true }); // yes, always stay fixed
this.position = UIElement.initPositionProps({ ...element.position });
}
getElementComponent(): Type<ElementComponent> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment