Skip to content

Commit

Permalink
feat: view组件支持所有view标签属性;fovmin->fovMin
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
将fovmin/fovmax重命名为fovMin/fovMax
  • Loading branch information
0xLLLLH committed Dec 17, 2020
1 parent b59b895 commit 2b615e2
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/KrpanoActionProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class KrpanoActionProxy {
this.krpanoRenderer?.call(actionStr);
}

set(name: string, ...params: (string | number | boolean)[]): void {
set(name: string, ...params: Array<string | number | boolean>): void {
this.call(buildKrpanoAction('set', name, ...params));
}

Expand Down
37 changes: 35 additions & 2 deletions src/components/View.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
import React, { useContext } from 'react';
import { KrpanoRendererContext } from '../contexts/KrpanoRendererContext';

/**
* @see https://krpano.com/docu/xml/#view
*/
interface ViewProps {
hlookat?: number;
vlookat?: number;
fov?: number;
fovmin?: number;
fovmax?: number;
fovMin?: number;
fovMax?: number;
camRoll?: number;
/**
* @see https://krpano.com/docu/xml/#view.fovtype
*/
fovType?: 'VFOV' | 'HFOV' | 'DFOV' | 'MFOV' | 'SFOV';
maxPixelZoom?: number;
mFovRatio?: number;
distortion?: number;
distortionFovLink?: number;
stereographic?: boolean;
pannini?: number;
architectural?: number;
architecturalOnlyMiddle?: boolean;
/**
* @see https://krpano.com/docu/xml/#view.limitview
*/
limitView?: 'off' | 'auto' | 'lookat' | 'range' | 'fullrange' | 'offrange';
hlookatMin?: number;
hlookatMax?: number;
vlookatMin?: number;
vlookatMax?: number;
rx?: number;
ry?: number;
tx?: number;
ty?: number;
tz?: number;
ox?: number;
oy?: number;
oz?: number;
children: null;
}

const View: React.FC<ViewProps> = ({ children, ...viewAttrs }) => {
Expand Down

0 comments on commit 2b615e2

Please sign in to comment.