/* static */ int DOM_CSSMatrix::rotate(DOM_Object* this_object, ES_Value* argv, int argc, ES_Value* return_value, DOM_Runtime* origining_runtime) { DOM_THIS_OBJECT(matrix, DOM_TYPE_CSS_MATRIX, DOM_CSSMatrix); DOM_CHECK_ARGUMENTS("n"); double s = argv[0].value.number; AffineTransform tmp; // Input is in degrees, AffineTransform wants radians. float radians = static_cast<float>(s * M_PI / 180.0); tmp.LoadRotate(radians); AffineTransform transform = matrix->transform; transform.PostMultiply(tmp); DOM_CSSMatrix *result_matrix; if (OpStatus::IsMemoryError(DOM_CSSMatrix::Make(result_matrix, transform, matrix->style_declaration))) return ES_NO_MEMORY; DOMSetObject(return_value, result_matrix); return ES_VALUE; }