}
public boolean mouseWheelMoved(int pRotateAmount) {
if (pRotateAmount != 0) {
if (config.getMouseDragOperation() == MouseDragOperation.VIEW && flameHolder != null && flameHolder.getFlame() != null) {
Flame flame = flameHolder.getFlame();
double dx = pRotateAmount * 3.0;
if (fineMovement) {
dx *= 0.1;
}
flame.setPixelsPerUnit(flame.getPixelsPerUnit() - dx);
return true;
}
if (config.getMouseDragOperation() == MouseDragOperation.TRIANGLE_VIEW && flameHolder != null && flameHolder.getFlame() != null) {
double dx = pRotateAmount * 0.3;
if (fineMovement) {
dx *= 0.1;
}
viewSizeIncrease -= dx;
return true;
}
else if (config.getMouseDragOperation() == MouseDragOperation.MOVE_TRIANGLE && selectedXForm != null) {
double dx = -pRotateAmount * 0.1;
double dy = dx;
if (fineMovement) {
dx *= 0.1;
dy *= 0.1;
}
TriangleControlShape triangle = new TriangleControlShape(config, selectedXForm);
double v1x = triangle.x[0] - triangle.x[1];
double v1y = triangle.y[0] - triangle.y[1];
double v2x = v1x + dx;
double v2y = v1y + dy;
double dr1 = Math.sqrt(v1x * v1x + v1y * v1y);
double dr2 = Math.sqrt(v2x * v2x + v2y * v2y);
double scale = dr2 / dr1;
if (config.isEditPostTransform()) {
if (allowScaleX) {
selectedXForm.setPostCoeff00(selectedXForm.getPostCoeff00() * scale);
selectedXForm.setPostCoeff01(selectedXForm.getPostCoeff01() * scale);
}
if (allowScaleY) {
selectedXForm.setPostCoeff10(selectedXForm.getPostCoeff10() * scale);
selectedXForm.setPostCoeff11(selectedXForm.getPostCoeff11() * scale);
}
}
else {
if (allowScaleX) {
selectedXForm.setCoeff00(selectedXForm.getCoeff00() * scale);
selectedXForm.setCoeff01(selectedXForm.getCoeff01() * scale);
}
if (allowScaleY) {
selectedXForm.setCoeff10(selectedXForm.getCoeff10() * scale);
selectedXForm.setCoeff11(selectedXForm.getCoeff11() * scale);
}
}
return true;
}
else if (config.getMouseDragOperation() == MouseDragOperation.FOCUS && flameHolder != null && flameHolder.getFlame() != null) {
double dz = -pRotateAmount * 0.1;
if (fineMovement) {
dz *= 0.1;
}
Flame flame = flameHolder.getFlame();
flame.setFocusZ(flame.getFocusZ() + dz);
return true;
}
else if (config.getMouseDragOperation() == MouseDragOperation.GRADIENT && flameHolder != null && flameHolder.getFlame() != null) {
double dz = -pRotateAmount * 0.1;
if (fineMovement) {