@@ -125,6 +125,10 @@ ZEND_BEGIN_ARG_INFO_EX(format_font_arginfo, 0, 0, 1)
125125 ZEND_ARG_INFO (0 , font )
126126ZEND_END_ARG_INFO ()
127127
128+ ZEND_BEGIN_ARG_INFO_EX (format_rotation_arginfo , 0 , 0 , 1 )
129+ ZEND_ARG_INFO (0 , angle )
130+ ZEND_END_ARG_INFO ()
131+
128132ZEND_BEGIN_ARG_INFO_EX (format_to_resource_arginfo , 0 , 0 , 0 )
129133ZEND_END_ARG_INFO ()
130134/* }}} */
@@ -479,6 +483,26 @@ PHP_METHOD(vtiful_format, borderColorOfTheFourSides)
479483}
480484/* }}} */
481485
486+ /** {{{ \Vtiful\Kernel\Format::rotation(int $angle)
487+ */
488+ PHP_METHOD (vtiful_format , rotation )
489+ {
490+ zend_long angle = 0 ;
491+
492+ ZEND_PARSE_PARAMETERS_START (1 , 1 )
493+ Z_PARAM_LONG (angle )
494+ ZEND_PARSE_PARAMETERS_END ();
495+
496+ ZVAL_COPY (return_value , getThis ());
497+
498+ format_object * obj = Z_FORMAT_P (getThis ());
499+
500+ if (obj -> ptr .format && ((angle >= -90 && angle <= 90 ) || angle == 270 )) {
501+ format_set_rotation (obj -> ptr .format , angle );
502+ }
503+ }
504+ /* }}} */
505+
482506/** {{{ \Vtiful\Kernel\Format::toResource()
483507 */
484508PHP_METHOD (vtiful_format , toResource )
@@ -508,6 +532,7 @@ zend_function_entry format_methods[] = {
508532 PHP_ME (vtiful_format , strikeout , format_strikeout_arginfo , ZEND_ACC_PUBLIC )
509533 PHP_ME (vtiful_format , underline , format_underline_arginfo , ZEND_ACC_PUBLIC )
510534 PHP_ME (vtiful_format , unlocked , format_unlocked_arginfo , ZEND_ACC_PUBLIC )
535+ PHP_ME (vtiful_format , rotation , format_rotation_arginfo , ZEND_ACC_PUBLIC )
511536 PHP_ME (vtiful_format , toResource , format_to_resource_arginfo , ZEND_ACC_PUBLIC )
512537 PHP_ME (vtiful_format , background , format_background_arginfo , ZEND_ACC_PUBLIC )
513538 PHP_FE_END
0 commit comments