为角度进度指示器设置svg圆的r属性

时间:2018-02-23 22:08:14

标签: html angular svg

阅读through some angular component code代码和svg圈子的posts属性设置如下:

r

这样可行,所以我只想了解原因? IIUC [attr.r]="radius - stroke / 2" 属性是svg圆的半径,所以我很好奇为什么不直接使用组件的radius属性?

2 个答案:

答案 0 :(得分:0)

您无法绑定到''' Flask Application Factory Blueprint Flask application using the factory pattern, with configuration setup and blueprint module registration ''' from flask import Flask from flask_bootstrap import Bootstrap from flask_security import Security from flask_security import SQLAlchemyUserDatastore from flask_debugtoolbar import DebugToolbarExtension from flask_admin import Admin from flask_admin.contrib.sqla import ModelView from .models import db from .models import User from .models import Role from .admin import admin def create_app(): ''' create_app input: None output: app -- flask web application instance Read configuration values in the following order: 1) default, values which can be overwritten later 2) intance, for your eyes only not stored in repo values 3) environment, selectable values from: - development - stagging - production Setup web interface with Bootstrap framework ''' # Initialize app app = Flask(__name__, instance_relative_config=True) # Load default config values app.config.from_object('config.default') # Load instance config values not stored in repo app.config.from_pyfile('config.py') # Load environment config values app.config.from_envvar('APP_CONFIG_FILE') # Create database connection db.init_app(app) # Instantiate Admin section admin.init_app(app) # Initialize bootstrap Bootstrap(app) # Setup Flask-Security security = Security(app, SQLAlchemyUserDatastore(db, User, Role)) # Debug = True to enable the toolbar toolbar = DebugToolbarExtension(app) # Load blueprint modules from application.site.routes import mod as site from application.api.routes import mod as api # Register blueprint modules for use app.register_blueprint(site) app.register_blueprint(api, url_prefix='/api') return app ,因为它是属性。 Angular允许您仅直接绑定属性,而不是属性。那么为什么你需要通过r

绑定它

答案 1 :(得分:0)

  

属性是svg圆的半径,所以我很好奇为什么不直接使用组件的radius属性?

绘制SVG中的笔划,使其中心跟随路径。因此,对于圆圈,笔划涵盖从radius + stroke/2radius的区域。

猜测一下,我会说作者希望radius - stroke对应于描边圆的外半径。所以他们减去了一半的笔画宽度。这意味着现在笔划覆盖了从radius for X := 0 to srcBitmap.Width-1 do begin AlphaScanLine[X] := (OpacityMap[Y][X] shl 24)+FillRGB; AlphaScanLine[X] := PremultiplyAlpha(AlphaScanLine[X]); // Add this for premultiplied Alpha end; 的区域。